Left Termination of the query pattern ways_in_3(g, g, a) w.r.t. the given Prolog program could successfully be proven:



Prolog
  ↳ PredefinedPredicateTransformerProof

Clauses:

nat(0).
nat(s(X)) :- nat(X).
plus(0, X, X) :- nat(X).
plus(s(X), Y, s(Z)) :- plus(X, Y, Z).
ways(0, _, s(0)).
ways(_, [], 0).
ways(Amount, .(s(C), Coins), N) :- ','(=(Amount, s(_)), ','(plus(s(C), NewAmount, Amount), ','(ways(Amount, Coins, N1), ','(ways(NewAmount, .(s(C), Coins), N2), plus(N1, N2, N))))).
ways(Amount, .(s(C), Coins), N) :- ','(=(Amount, s(_)), ','(plus(Amount, s(_), s(C)), ways(Amount, Coins, N))).

Queries:

ways(g,g,a).

Added definitions of predefined predicates.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
Prolog
      ↳ PrologToPiTRSProof
      ↳ PrologToPiTRSProof

Clauses:

nat(0).
nat(s(X)) :- nat(X).
plus(0, X, X) :- nat(X).
plus(s(X), Y, s(Z)) :- plus(X, Y, Z).
ways(0, X, s(0)).
ways(X, [], 0).
ways(Amount, .(s(C), Coins), N) :- ','(=(Amount, s(X)), ','(plus(s(C), NewAmount, Amount), ','(ways(Amount, Coins, N1), ','(ways(NewAmount, .(s(C), Coins), N2), plus(N1, N2, N))))).
ways(Amount, .(s(C), Coins), N) :- ','(=(Amount, s(X)), ','(plus(Amount, s(X1), s(C)), ways(Amount, Coins, N))).
=(X, X).

Queries:

ways(g,g,a).

We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
ways_in: (b,b,f)
plus_in: (b,f,b) (b,b,f)
nat_in: (b)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

ways_in_gga(0, X, s(0)) → ways_out_gga(0, X, s(0))
ways_in_gga(X, [], 0) → ways_out_gga(X, [], 0)
ways_in_gga(Amount, .(s(C), Coins), N) → U4_gga(Amount, C, Coins, N, =_in_ga(Amount, s(X)))
=_in_ga(X, X) → =_out_ga(X, X)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U5_gga(Amount, C, Coins, N, X, plus_in_gag(s(C), NewAmount, Amount))
plus_in_gag(0, X, X) → U2_gag(X, nat_in_g(X))
nat_in_g(0) → nat_out_g(0)
nat_in_g(s(X)) → U1_g(X, nat_in_g(X))
U1_g(X, nat_out_g(X)) → nat_out_g(s(X))
U2_gag(X, nat_out_g(X)) → plus_out_gag(0, X, X)
plus_in_gag(s(X), Y, s(Z)) → U3_gag(X, Y, Z, plus_in_gag(X, Y, Z))
U3_gag(X, Y, Z, plus_out_gag(X, Y, Z)) → plus_out_gag(s(X), Y, s(Z))
U5_gga(Amount, C, Coins, N, X, plus_out_gag(s(C), NewAmount, Amount)) → U6_gga(Amount, C, Coins, N, X, NewAmount, ways_in_gga(Amount, Coins, N1))
U6_gga(Amount, C, Coins, N, X, NewAmount, ways_out_gga(Amount, Coins, N1)) → U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_in_gga(NewAmount, .(s(C), Coins), N2))
U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_out_gga(NewAmount, .(s(C), Coins), N2)) → U8_gga(Amount, C, Coins, N, plus_in_gga(N1, N2, N))
plus_in_gga(0, X, X) → U2_gga(X, nat_in_g(X))
U2_gga(X, nat_out_g(X)) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U3_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U3_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U8_gga(Amount, C, Coins, N, plus_out_gga(N1, N2, N)) → ways_out_gga(Amount, .(s(C), Coins), N)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U9_gga(Amount, C, Coins, N, X, plus_in_gag(Amount, s(X1), s(C)))
U9_gga(Amount, C, Coins, N, X, plus_out_gag(Amount, s(X1), s(C))) → U10_gga(Amount, C, Coins, N, ways_in_gga(Amount, Coins, N))
U10_gga(Amount, C, Coins, N, ways_out_gga(Amount, Coins, N)) → ways_out_gga(Amount, .(s(C), Coins), N)

The argument filtering Pi contains the following mapping:
ways_in_gga(x1, x2, x3)  =  ways_in_gga(x1, x2)
0  =  0
ways_out_gga(x1, x2, x3)  =  ways_out_gga(x3)
[]  =  []
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
U4_gga(x1, x2, x3, x4, x5)  =  U4_gga(x1, x2, x3, x5)
=_in_ga(x1, x2)  =  =_in_ga(x1)
=_out_ga(x1, x2)  =  =_out_ga(x2)
U5_gga(x1, x2, x3, x4, x5, x6)  =  U5_gga(x1, x2, x3, x6)
plus_in_gag(x1, x2, x3)  =  plus_in_gag(x1, x3)
U2_gag(x1, x2)  =  U2_gag(x1, x2)
nat_in_g(x1)  =  nat_in_g(x1)
nat_out_g(x1)  =  nat_out_g
U1_g(x1, x2)  =  U1_g(x2)
plus_out_gag(x1, x2, x3)  =  plus_out_gag(x2)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x4)
U6_gga(x1, x2, x3, x4, x5, x6, x7)  =  U6_gga(x2, x3, x6, x7)
U7_gga(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_gga(x7, x8)
U8_gga(x1, x2, x3, x4, x5)  =  U8_gga(x5)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
U2_gga(x1, x2)  =  U2_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x4)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x3, x6)
U10_gga(x1, x2, x3, x4, x5)  =  U10_gga(x5)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
PiTRS
          ↳ DependencyPairsProof
      ↳ PrologToPiTRSProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

ways_in_gga(0, X, s(0)) → ways_out_gga(0, X, s(0))
ways_in_gga(X, [], 0) → ways_out_gga(X, [], 0)
ways_in_gga(Amount, .(s(C), Coins), N) → U4_gga(Amount, C, Coins, N, =_in_ga(Amount, s(X)))
=_in_ga(X, X) → =_out_ga(X, X)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U5_gga(Amount, C, Coins, N, X, plus_in_gag(s(C), NewAmount, Amount))
plus_in_gag(0, X, X) → U2_gag(X, nat_in_g(X))
nat_in_g(0) → nat_out_g(0)
nat_in_g(s(X)) → U1_g(X, nat_in_g(X))
U1_g(X, nat_out_g(X)) → nat_out_g(s(X))
U2_gag(X, nat_out_g(X)) → plus_out_gag(0, X, X)
plus_in_gag(s(X), Y, s(Z)) → U3_gag(X, Y, Z, plus_in_gag(X, Y, Z))
U3_gag(X, Y, Z, plus_out_gag(X, Y, Z)) → plus_out_gag(s(X), Y, s(Z))
U5_gga(Amount, C, Coins, N, X, plus_out_gag(s(C), NewAmount, Amount)) → U6_gga(Amount, C, Coins, N, X, NewAmount, ways_in_gga(Amount, Coins, N1))
U6_gga(Amount, C, Coins, N, X, NewAmount, ways_out_gga(Amount, Coins, N1)) → U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_in_gga(NewAmount, .(s(C), Coins), N2))
U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_out_gga(NewAmount, .(s(C), Coins), N2)) → U8_gga(Amount, C, Coins, N, plus_in_gga(N1, N2, N))
plus_in_gga(0, X, X) → U2_gga(X, nat_in_g(X))
U2_gga(X, nat_out_g(X)) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U3_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U3_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U8_gga(Amount, C, Coins, N, plus_out_gga(N1, N2, N)) → ways_out_gga(Amount, .(s(C), Coins), N)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U9_gga(Amount, C, Coins, N, X, plus_in_gag(Amount, s(X1), s(C)))
U9_gga(Amount, C, Coins, N, X, plus_out_gag(Amount, s(X1), s(C))) → U10_gga(Amount, C, Coins, N, ways_in_gga(Amount, Coins, N))
U10_gga(Amount, C, Coins, N, ways_out_gga(Amount, Coins, N)) → ways_out_gga(Amount, .(s(C), Coins), N)

The argument filtering Pi contains the following mapping:
ways_in_gga(x1, x2, x3)  =  ways_in_gga(x1, x2)
0  =  0
ways_out_gga(x1, x2, x3)  =  ways_out_gga(x3)
[]  =  []
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
U4_gga(x1, x2, x3, x4, x5)  =  U4_gga(x1, x2, x3, x5)
=_in_ga(x1, x2)  =  =_in_ga(x1)
=_out_ga(x1, x2)  =  =_out_ga(x2)
U5_gga(x1, x2, x3, x4, x5, x6)  =  U5_gga(x1, x2, x3, x6)
plus_in_gag(x1, x2, x3)  =  plus_in_gag(x1, x3)
U2_gag(x1, x2)  =  U2_gag(x1, x2)
nat_in_g(x1)  =  nat_in_g(x1)
nat_out_g(x1)  =  nat_out_g
U1_g(x1, x2)  =  U1_g(x2)
plus_out_gag(x1, x2, x3)  =  plus_out_gag(x2)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x4)
U6_gga(x1, x2, x3, x4, x5, x6, x7)  =  U6_gga(x2, x3, x6, x7)
U7_gga(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_gga(x7, x8)
U8_gga(x1, x2, x3, x4, x5)  =  U8_gga(x5)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
U2_gga(x1, x2)  =  U2_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x4)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x3, x6)
U10_gga(x1, x2, x3, x4, x5)  =  U10_gga(x5)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

WAYS_IN_GGA(Amount, .(s(C), Coins), N) → U4_GGA(Amount, C, Coins, N, =_in_ga(Amount, s(X)))
WAYS_IN_GGA(Amount, .(s(C), Coins), N) → =_IN_GA(Amount, s(X))
U4_GGA(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U5_GGA(Amount, C, Coins, N, X, plus_in_gag(s(C), NewAmount, Amount))
U4_GGA(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → PLUS_IN_GAG(s(C), NewAmount, Amount)
PLUS_IN_GAG(0, X, X) → U2_GAG(X, nat_in_g(X))
PLUS_IN_GAG(0, X, X) → NAT_IN_G(X)
NAT_IN_G(s(X)) → U1_G(X, nat_in_g(X))
NAT_IN_G(s(X)) → NAT_IN_G(X)
PLUS_IN_GAG(s(X), Y, s(Z)) → U3_GAG(X, Y, Z, plus_in_gag(X, Y, Z))
PLUS_IN_GAG(s(X), Y, s(Z)) → PLUS_IN_GAG(X, Y, Z)
U5_GGA(Amount, C, Coins, N, X, plus_out_gag(s(C), NewAmount, Amount)) → U6_GGA(Amount, C, Coins, N, X, NewAmount, ways_in_gga(Amount, Coins, N1))
U5_GGA(Amount, C, Coins, N, X, plus_out_gag(s(C), NewAmount, Amount)) → WAYS_IN_GGA(Amount, Coins, N1)
U6_GGA(Amount, C, Coins, N, X, NewAmount, ways_out_gga(Amount, Coins, N1)) → U7_GGA(Amount, C, Coins, N, X, NewAmount, N1, ways_in_gga(NewAmount, .(s(C), Coins), N2))
U6_GGA(Amount, C, Coins, N, X, NewAmount, ways_out_gga(Amount, Coins, N1)) → WAYS_IN_GGA(NewAmount, .(s(C), Coins), N2)
U7_GGA(Amount, C, Coins, N, X, NewAmount, N1, ways_out_gga(NewAmount, .(s(C), Coins), N2)) → U8_GGA(Amount, C, Coins, N, plus_in_gga(N1, N2, N))
U7_GGA(Amount, C, Coins, N, X, NewAmount, N1, ways_out_gga(NewAmount, .(s(C), Coins), N2)) → PLUS_IN_GGA(N1, N2, N)
PLUS_IN_GGA(0, X, X) → U2_GGA(X, nat_in_g(X))
PLUS_IN_GGA(0, X, X) → NAT_IN_G(X)
PLUS_IN_GGA(s(X), Y, s(Z)) → U3_GGA(X, Y, Z, plus_in_gga(X, Y, Z))
PLUS_IN_GGA(s(X), Y, s(Z)) → PLUS_IN_GGA(X, Y, Z)
U4_GGA(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U9_GGA(Amount, C, Coins, N, X, plus_in_gag(Amount, s(X1), s(C)))
U4_GGA(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → PLUS_IN_GAG(Amount, s(X1), s(C))
U9_GGA(Amount, C, Coins, N, X, plus_out_gag(Amount, s(X1), s(C))) → U10_GGA(Amount, C, Coins, N, ways_in_gga(Amount, Coins, N))
U9_GGA(Amount, C, Coins, N, X, plus_out_gag(Amount, s(X1), s(C))) → WAYS_IN_GGA(Amount, Coins, N)

The TRS R consists of the following rules:

ways_in_gga(0, X, s(0)) → ways_out_gga(0, X, s(0))
ways_in_gga(X, [], 0) → ways_out_gga(X, [], 0)
ways_in_gga(Amount, .(s(C), Coins), N) → U4_gga(Amount, C, Coins, N, =_in_ga(Amount, s(X)))
=_in_ga(X, X) → =_out_ga(X, X)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U5_gga(Amount, C, Coins, N, X, plus_in_gag(s(C), NewAmount, Amount))
plus_in_gag(0, X, X) → U2_gag(X, nat_in_g(X))
nat_in_g(0) → nat_out_g(0)
nat_in_g(s(X)) → U1_g(X, nat_in_g(X))
U1_g(X, nat_out_g(X)) → nat_out_g(s(X))
U2_gag(X, nat_out_g(X)) → plus_out_gag(0, X, X)
plus_in_gag(s(X), Y, s(Z)) → U3_gag(X, Y, Z, plus_in_gag(X, Y, Z))
U3_gag(X, Y, Z, plus_out_gag(X, Y, Z)) → plus_out_gag(s(X), Y, s(Z))
U5_gga(Amount, C, Coins, N, X, plus_out_gag(s(C), NewAmount, Amount)) → U6_gga(Amount, C, Coins, N, X, NewAmount, ways_in_gga(Amount, Coins, N1))
U6_gga(Amount, C, Coins, N, X, NewAmount, ways_out_gga(Amount, Coins, N1)) → U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_in_gga(NewAmount, .(s(C), Coins), N2))
U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_out_gga(NewAmount, .(s(C), Coins), N2)) → U8_gga(Amount, C, Coins, N, plus_in_gga(N1, N2, N))
plus_in_gga(0, X, X) → U2_gga(X, nat_in_g(X))
U2_gga(X, nat_out_g(X)) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U3_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U3_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U8_gga(Amount, C, Coins, N, plus_out_gga(N1, N2, N)) → ways_out_gga(Amount, .(s(C), Coins), N)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U9_gga(Amount, C, Coins, N, X, plus_in_gag(Amount, s(X1), s(C)))
U9_gga(Amount, C, Coins, N, X, plus_out_gag(Amount, s(X1), s(C))) → U10_gga(Amount, C, Coins, N, ways_in_gga(Amount, Coins, N))
U10_gga(Amount, C, Coins, N, ways_out_gga(Amount, Coins, N)) → ways_out_gga(Amount, .(s(C), Coins), N)

The argument filtering Pi contains the following mapping:
ways_in_gga(x1, x2, x3)  =  ways_in_gga(x1, x2)
0  =  0
ways_out_gga(x1, x2, x3)  =  ways_out_gga(x3)
[]  =  []
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
U4_gga(x1, x2, x3, x4, x5)  =  U4_gga(x1, x2, x3, x5)
=_in_ga(x1, x2)  =  =_in_ga(x1)
=_out_ga(x1, x2)  =  =_out_ga(x2)
U5_gga(x1, x2, x3, x4, x5, x6)  =  U5_gga(x1, x2, x3, x6)
plus_in_gag(x1, x2, x3)  =  plus_in_gag(x1, x3)
U2_gag(x1, x2)  =  U2_gag(x1, x2)
nat_in_g(x1)  =  nat_in_g(x1)
nat_out_g(x1)  =  nat_out_g
U1_g(x1, x2)  =  U1_g(x2)
plus_out_gag(x1, x2, x3)  =  plus_out_gag(x2)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x4)
U6_gga(x1, x2, x3, x4, x5, x6, x7)  =  U6_gga(x2, x3, x6, x7)
U7_gga(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_gga(x7, x8)
U8_gga(x1, x2, x3, x4, x5)  =  U8_gga(x5)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
U2_gga(x1, x2)  =  U2_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x4)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x3, x6)
U10_gga(x1, x2, x3, x4, x5)  =  U10_gga(x5)
NAT_IN_G(x1)  =  NAT_IN_G(x1)
U3_GAG(x1, x2, x3, x4)  =  U3_GAG(x4)
U7_GGA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_GGA(x7, x8)
U4_GGA(x1, x2, x3, x4, x5)  =  U4_GGA(x1, x2, x3, x5)
U2_GGA(x1, x2)  =  U2_GGA(x1, x2)
U1_G(x1, x2)  =  U1_G(x2)
U2_GAG(x1, x2)  =  U2_GAG(x1, x2)
U8_GGA(x1, x2, x3, x4, x5)  =  U8_GGA(x5)
PLUS_IN_GAG(x1, x2, x3)  =  PLUS_IN_GAG(x1, x3)
U10_GGA(x1, x2, x3, x4, x5)  =  U10_GGA(x5)
U9_GGA(x1, x2, x3, x4, x5, x6)  =  U9_GGA(x1, x3, x6)
U6_GGA(x1, x2, x3, x4, x5, x6, x7)  =  U6_GGA(x2, x3, x6, x7)
PLUS_IN_GGA(x1, x2, x3)  =  PLUS_IN_GGA(x1, x2)
=_IN_GA(x1, x2)  =  =_IN_GA(x1)
U5_GGA(x1, x2, x3, x4, x5, x6)  =  U5_GGA(x1, x2, x3, x6)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x4)
WAYS_IN_GGA(x1, x2, x3)  =  WAYS_IN_GGA(x1, x2)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
PiDP
              ↳ DependencyGraphProof
      ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

WAYS_IN_GGA(Amount, .(s(C), Coins), N) → U4_GGA(Amount, C, Coins, N, =_in_ga(Amount, s(X)))
WAYS_IN_GGA(Amount, .(s(C), Coins), N) → =_IN_GA(Amount, s(X))
U4_GGA(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U5_GGA(Amount, C, Coins, N, X, plus_in_gag(s(C), NewAmount, Amount))
U4_GGA(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → PLUS_IN_GAG(s(C), NewAmount, Amount)
PLUS_IN_GAG(0, X, X) → U2_GAG(X, nat_in_g(X))
PLUS_IN_GAG(0, X, X) → NAT_IN_G(X)
NAT_IN_G(s(X)) → U1_G(X, nat_in_g(X))
NAT_IN_G(s(X)) → NAT_IN_G(X)
PLUS_IN_GAG(s(X), Y, s(Z)) → U3_GAG(X, Y, Z, plus_in_gag(X, Y, Z))
PLUS_IN_GAG(s(X), Y, s(Z)) → PLUS_IN_GAG(X, Y, Z)
U5_GGA(Amount, C, Coins, N, X, plus_out_gag(s(C), NewAmount, Amount)) → U6_GGA(Amount, C, Coins, N, X, NewAmount, ways_in_gga(Amount, Coins, N1))
U5_GGA(Amount, C, Coins, N, X, plus_out_gag(s(C), NewAmount, Amount)) → WAYS_IN_GGA(Amount, Coins, N1)
U6_GGA(Amount, C, Coins, N, X, NewAmount, ways_out_gga(Amount, Coins, N1)) → U7_GGA(Amount, C, Coins, N, X, NewAmount, N1, ways_in_gga(NewAmount, .(s(C), Coins), N2))
U6_GGA(Amount, C, Coins, N, X, NewAmount, ways_out_gga(Amount, Coins, N1)) → WAYS_IN_GGA(NewAmount, .(s(C), Coins), N2)
U7_GGA(Amount, C, Coins, N, X, NewAmount, N1, ways_out_gga(NewAmount, .(s(C), Coins), N2)) → U8_GGA(Amount, C, Coins, N, plus_in_gga(N1, N2, N))
U7_GGA(Amount, C, Coins, N, X, NewAmount, N1, ways_out_gga(NewAmount, .(s(C), Coins), N2)) → PLUS_IN_GGA(N1, N2, N)
PLUS_IN_GGA(0, X, X) → U2_GGA(X, nat_in_g(X))
PLUS_IN_GGA(0, X, X) → NAT_IN_G(X)
PLUS_IN_GGA(s(X), Y, s(Z)) → U3_GGA(X, Y, Z, plus_in_gga(X, Y, Z))
PLUS_IN_GGA(s(X), Y, s(Z)) → PLUS_IN_GGA(X, Y, Z)
U4_GGA(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U9_GGA(Amount, C, Coins, N, X, plus_in_gag(Amount, s(X1), s(C)))
U4_GGA(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → PLUS_IN_GAG(Amount, s(X1), s(C))
U9_GGA(Amount, C, Coins, N, X, plus_out_gag(Amount, s(X1), s(C))) → U10_GGA(Amount, C, Coins, N, ways_in_gga(Amount, Coins, N))
U9_GGA(Amount, C, Coins, N, X, plus_out_gag(Amount, s(X1), s(C))) → WAYS_IN_GGA(Amount, Coins, N)

The TRS R consists of the following rules:

ways_in_gga(0, X, s(0)) → ways_out_gga(0, X, s(0))
ways_in_gga(X, [], 0) → ways_out_gga(X, [], 0)
ways_in_gga(Amount, .(s(C), Coins), N) → U4_gga(Amount, C, Coins, N, =_in_ga(Amount, s(X)))
=_in_ga(X, X) → =_out_ga(X, X)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U5_gga(Amount, C, Coins, N, X, plus_in_gag(s(C), NewAmount, Amount))
plus_in_gag(0, X, X) → U2_gag(X, nat_in_g(X))
nat_in_g(0) → nat_out_g(0)
nat_in_g(s(X)) → U1_g(X, nat_in_g(X))
U1_g(X, nat_out_g(X)) → nat_out_g(s(X))
U2_gag(X, nat_out_g(X)) → plus_out_gag(0, X, X)
plus_in_gag(s(X), Y, s(Z)) → U3_gag(X, Y, Z, plus_in_gag(X, Y, Z))
U3_gag(X, Y, Z, plus_out_gag(X, Y, Z)) → plus_out_gag(s(X), Y, s(Z))
U5_gga(Amount, C, Coins, N, X, plus_out_gag(s(C), NewAmount, Amount)) → U6_gga(Amount, C, Coins, N, X, NewAmount, ways_in_gga(Amount, Coins, N1))
U6_gga(Amount, C, Coins, N, X, NewAmount, ways_out_gga(Amount, Coins, N1)) → U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_in_gga(NewAmount, .(s(C), Coins), N2))
U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_out_gga(NewAmount, .(s(C), Coins), N2)) → U8_gga(Amount, C, Coins, N, plus_in_gga(N1, N2, N))
plus_in_gga(0, X, X) → U2_gga(X, nat_in_g(X))
U2_gga(X, nat_out_g(X)) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U3_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U3_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U8_gga(Amount, C, Coins, N, plus_out_gga(N1, N2, N)) → ways_out_gga(Amount, .(s(C), Coins), N)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U9_gga(Amount, C, Coins, N, X, plus_in_gag(Amount, s(X1), s(C)))
U9_gga(Amount, C, Coins, N, X, plus_out_gag(Amount, s(X1), s(C))) → U10_gga(Amount, C, Coins, N, ways_in_gga(Amount, Coins, N))
U10_gga(Amount, C, Coins, N, ways_out_gga(Amount, Coins, N)) → ways_out_gga(Amount, .(s(C), Coins), N)

The argument filtering Pi contains the following mapping:
ways_in_gga(x1, x2, x3)  =  ways_in_gga(x1, x2)
0  =  0
ways_out_gga(x1, x2, x3)  =  ways_out_gga(x3)
[]  =  []
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
U4_gga(x1, x2, x3, x4, x5)  =  U4_gga(x1, x2, x3, x5)
=_in_ga(x1, x2)  =  =_in_ga(x1)
=_out_ga(x1, x2)  =  =_out_ga(x2)
U5_gga(x1, x2, x3, x4, x5, x6)  =  U5_gga(x1, x2, x3, x6)
plus_in_gag(x1, x2, x3)  =  plus_in_gag(x1, x3)
U2_gag(x1, x2)  =  U2_gag(x1, x2)
nat_in_g(x1)  =  nat_in_g(x1)
nat_out_g(x1)  =  nat_out_g
U1_g(x1, x2)  =  U1_g(x2)
plus_out_gag(x1, x2, x3)  =  plus_out_gag(x2)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x4)
U6_gga(x1, x2, x3, x4, x5, x6, x7)  =  U6_gga(x2, x3, x6, x7)
U7_gga(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_gga(x7, x8)
U8_gga(x1, x2, x3, x4, x5)  =  U8_gga(x5)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
U2_gga(x1, x2)  =  U2_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x4)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x3, x6)
U10_gga(x1, x2, x3, x4, x5)  =  U10_gga(x5)
NAT_IN_G(x1)  =  NAT_IN_G(x1)
U3_GAG(x1, x2, x3, x4)  =  U3_GAG(x4)
U7_GGA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_GGA(x7, x8)
U4_GGA(x1, x2, x3, x4, x5)  =  U4_GGA(x1, x2, x3, x5)
U2_GGA(x1, x2)  =  U2_GGA(x1, x2)
U1_G(x1, x2)  =  U1_G(x2)
U2_GAG(x1, x2)  =  U2_GAG(x1, x2)
U8_GGA(x1, x2, x3, x4, x5)  =  U8_GGA(x5)
PLUS_IN_GAG(x1, x2, x3)  =  PLUS_IN_GAG(x1, x3)
U10_GGA(x1, x2, x3, x4, x5)  =  U10_GGA(x5)
U9_GGA(x1, x2, x3, x4, x5, x6)  =  U9_GGA(x1, x3, x6)
U6_GGA(x1, x2, x3, x4, x5, x6, x7)  =  U6_GGA(x2, x3, x6, x7)
PLUS_IN_GGA(x1, x2, x3)  =  PLUS_IN_GGA(x1, x2)
=_IN_GA(x1, x2)  =  =_IN_GA(x1)
U5_GGA(x1, x2, x3, x4, x5, x6)  =  U5_GGA(x1, x2, x3, x6)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x4)
WAYS_IN_GGA(x1, x2, x3)  =  WAYS_IN_GGA(x1, x2)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 4 SCCs with 14 less nodes.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
PiDP
                    ↳ UsableRulesProof
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
      ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

NAT_IN_G(s(X)) → NAT_IN_G(X)

The TRS R consists of the following rules:

ways_in_gga(0, X, s(0)) → ways_out_gga(0, X, s(0))
ways_in_gga(X, [], 0) → ways_out_gga(X, [], 0)
ways_in_gga(Amount, .(s(C), Coins), N) → U4_gga(Amount, C, Coins, N, =_in_ga(Amount, s(X)))
=_in_ga(X, X) → =_out_ga(X, X)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U5_gga(Amount, C, Coins, N, X, plus_in_gag(s(C), NewAmount, Amount))
plus_in_gag(0, X, X) → U2_gag(X, nat_in_g(X))
nat_in_g(0) → nat_out_g(0)
nat_in_g(s(X)) → U1_g(X, nat_in_g(X))
U1_g(X, nat_out_g(X)) → nat_out_g(s(X))
U2_gag(X, nat_out_g(X)) → plus_out_gag(0, X, X)
plus_in_gag(s(X), Y, s(Z)) → U3_gag(X, Y, Z, plus_in_gag(X, Y, Z))
U3_gag(X, Y, Z, plus_out_gag(X, Y, Z)) → plus_out_gag(s(X), Y, s(Z))
U5_gga(Amount, C, Coins, N, X, plus_out_gag(s(C), NewAmount, Amount)) → U6_gga(Amount, C, Coins, N, X, NewAmount, ways_in_gga(Amount, Coins, N1))
U6_gga(Amount, C, Coins, N, X, NewAmount, ways_out_gga(Amount, Coins, N1)) → U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_in_gga(NewAmount, .(s(C), Coins), N2))
U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_out_gga(NewAmount, .(s(C), Coins), N2)) → U8_gga(Amount, C, Coins, N, plus_in_gga(N1, N2, N))
plus_in_gga(0, X, X) → U2_gga(X, nat_in_g(X))
U2_gga(X, nat_out_g(X)) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U3_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U3_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U8_gga(Amount, C, Coins, N, plus_out_gga(N1, N2, N)) → ways_out_gga(Amount, .(s(C), Coins), N)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U9_gga(Amount, C, Coins, N, X, plus_in_gag(Amount, s(X1), s(C)))
U9_gga(Amount, C, Coins, N, X, plus_out_gag(Amount, s(X1), s(C))) → U10_gga(Amount, C, Coins, N, ways_in_gga(Amount, Coins, N))
U10_gga(Amount, C, Coins, N, ways_out_gga(Amount, Coins, N)) → ways_out_gga(Amount, .(s(C), Coins), N)

The argument filtering Pi contains the following mapping:
ways_in_gga(x1, x2, x3)  =  ways_in_gga(x1, x2)
0  =  0
ways_out_gga(x1, x2, x3)  =  ways_out_gga(x3)
[]  =  []
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
U4_gga(x1, x2, x3, x4, x5)  =  U4_gga(x1, x2, x3, x5)
=_in_ga(x1, x2)  =  =_in_ga(x1)
=_out_ga(x1, x2)  =  =_out_ga(x2)
U5_gga(x1, x2, x3, x4, x5, x6)  =  U5_gga(x1, x2, x3, x6)
plus_in_gag(x1, x2, x3)  =  plus_in_gag(x1, x3)
U2_gag(x1, x2)  =  U2_gag(x1, x2)
nat_in_g(x1)  =  nat_in_g(x1)
nat_out_g(x1)  =  nat_out_g
U1_g(x1, x2)  =  U1_g(x2)
plus_out_gag(x1, x2, x3)  =  plus_out_gag(x2)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x4)
U6_gga(x1, x2, x3, x4, x5, x6, x7)  =  U6_gga(x2, x3, x6, x7)
U7_gga(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_gga(x7, x8)
U8_gga(x1, x2, x3, x4, x5)  =  U8_gga(x5)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
U2_gga(x1, x2)  =  U2_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x4)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x3, x6)
U10_gga(x1, x2, x3, x4, x5)  =  U10_gga(x5)
NAT_IN_G(x1)  =  NAT_IN_G(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                    ↳ UsableRulesProof
PiDP
                        ↳ PiDPToQDPProof
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
      ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

NAT_IN_G(s(X)) → NAT_IN_G(X)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                    ↳ UsableRulesProof
                      ↳ PiDP
                        ↳ PiDPToQDPProof
QDP
                            ↳ QDPSizeChangeProof
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
      ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

NAT_IN_G(s(X)) → NAT_IN_G(X)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
PiDP
                    ↳ UsableRulesProof
                  ↳ PiDP
                  ↳ PiDP
      ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

PLUS_IN_GGA(s(X), Y, s(Z)) → PLUS_IN_GGA(X, Y, Z)

The TRS R consists of the following rules:

ways_in_gga(0, X, s(0)) → ways_out_gga(0, X, s(0))
ways_in_gga(X, [], 0) → ways_out_gga(X, [], 0)
ways_in_gga(Amount, .(s(C), Coins), N) → U4_gga(Amount, C, Coins, N, =_in_ga(Amount, s(X)))
=_in_ga(X, X) → =_out_ga(X, X)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U5_gga(Amount, C, Coins, N, X, plus_in_gag(s(C), NewAmount, Amount))
plus_in_gag(0, X, X) → U2_gag(X, nat_in_g(X))
nat_in_g(0) → nat_out_g(0)
nat_in_g(s(X)) → U1_g(X, nat_in_g(X))
U1_g(X, nat_out_g(X)) → nat_out_g(s(X))
U2_gag(X, nat_out_g(X)) → plus_out_gag(0, X, X)
plus_in_gag(s(X), Y, s(Z)) → U3_gag(X, Y, Z, plus_in_gag(X, Y, Z))
U3_gag(X, Y, Z, plus_out_gag(X, Y, Z)) → plus_out_gag(s(X), Y, s(Z))
U5_gga(Amount, C, Coins, N, X, plus_out_gag(s(C), NewAmount, Amount)) → U6_gga(Amount, C, Coins, N, X, NewAmount, ways_in_gga(Amount, Coins, N1))
U6_gga(Amount, C, Coins, N, X, NewAmount, ways_out_gga(Amount, Coins, N1)) → U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_in_gga(NewAmount, .(s(C), Coins), N2))
U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_out_gga(NewAmount, .(s(C), Coins), N2)) → U8_gga(Amount, C, Coins, N, plus_in_gga(N1, N2, N))
plus_in_gga(0, X, X) → U2_gga(X, nat_in_g(X))
U2_gga(X, nat_out_g(X)) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U3_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U3_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U8_gga(Amount, C, Coins, N, plus_out_gga(N1, N2, N)) → ways_out_gga(Amount, .(s(C), Coins), N)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U9_gga(Amount, C, Coins, N, X, plus_in_gag(Amount, s(X1), s(C)))
U9_gga(Amount, C, Coins, N, X, plus_out_gag(Amount, s(X1), s(C))) → U10_gga(Amount, C, Coins, N, ways_in_gga(Amount, Coins, N))
U10_gga(Amount, C, Coins, N, ways_out_gga(Amount, Coins, N)) → ways_out_gga(Amount, .(s(C), Coins), N)

The argument filtering Pi contains the following mapping:
ways_in_gga(x1, x2, x3)  =  ways_in_gga(x1, x2)
0  =  0
ways_out_gga(x1, x2, x3)  =  ways_out_gga(x3)
[]  =  []
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
U4_gga(x1, x2, x3, x4, x5)  =  U4_gga(x1, x2, x3, x5)
=_in_ga(x1, x2)  =  =_in_ga(x1)
=_out_ga(x1, x2)  =  =_out_ga(x2)
U5_gga(x1, x2, x3, x4, x5, x6)  =  U5_gga(x1, x2, x3, x6)
plus_in_gag(x1, x2, x3)  =  plus_in_gag(x1, x3)
U2_gag(x1, x2)  =  U2_gag(x1, x2)
nat_in_g(x1)  =  nat_in_g(x1)
nat_out_g(x1)  =  nat_out_g
U1_g(x1, x2)  =  U1_g(x2)
plus_out_gag(x1, x2, x3)  =  plus_out_gag(x2)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x4)
U6_gga(x1, x2, x3, x4, x5, x6, x7)  =  U6_gga(x2, x3, x6, x7)
U7_gga(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_gga(x7, x8)
U8_gga(x1, x2, x3, x4, x5)  =  U8_gga(x5)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
U2_gga(x1, x2)  =  U2_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x4)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x3, x6)
U10_gga(x1, x2, x3, x4, x5)  =  U10_gga(x5)
PLUS_IN_GGA(x1, x2, x3)  =  PLUS_IN_GGA(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                    ↳ UsableRulesProof
PiDP
                        ↳ PiDPToQDPProof
                  ↳ PiDP
                  ↳ PiDP
      ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

PLUS_IN_GGA(s(X), Y, s(Z)) → PLUS_IN_GGA(X, Y, Z)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
PLUS_IN_GGA(x1, x2, x3)  =  PLUS_IN_GGA(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                    ↳ UsableRulesProof
                      ↳ PiDP
                        ↳ PiDPToQDPProof
QDP
                            ↳ QDPSizeChangeProof
                  ↳ PiDP
                  ↳ PiDP
      ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

PLUS_IN_GGA(s(X), Y) → PLUS_IN_GGA(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
PiDP
                    ↳ UsableRulesProof
                  ↳ PiDP
      ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

PLUS_IN_GAG(s(X), Y, s(Z)) → PLUS_IN_GAG(X, Y, Z)

The TRS R consists of the following rules:

ways_in_gga(0, X, s(0)) → ways_out_gga(0, X, s(0))
ways_in_gga(X, [], 0) → ways_out_gga(X, [], 0)
ways_in_gga(Amount, .(s(C), Coins), N) → U4_gga(Amount, C, Coins, N, =_in_ga(Amount, s(X)))
=_in_ga(X, X) → =_out_ga(X, X)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U5_gga(Amount, C, Coins, N, X, plus_in_gag(s(C), NewAmount, Amount))
plus_in_gag(0, X, X) → U2_gag(X, nat_in_g(X))
nat_in_g(0) → nat_out_g(0)
nat_in_g(s(X)) → U1_g(X, nat_in_g(X))
U1_g(X, nat_out_g(X)) → nat_out_g(s(X))
U2_gag(X, nat_out_g(X)) → plus_out_gag(0, X, X)
plus_in_gag(s(X), Y, s(Z)) → U3_gag(X, Y, Z, plus_in_gag(X, Y, Z))
U3_gag(X, Y, Z, plus_out_gag(X, Y, Z)) → plus_out_gag(s(X), Y, s(Z))
U5_gga(Amount, C, Coins, N, X, plus_out_gag(s(C), NewAmount, Amount)) → U6_gga(Amount, C, Coins, N, X, NewAmount, ways_in_gga(Amount, Coins, N1))
U6_gga(Amount, C, Coins, N, X, NewAmount, ways_out_gga(Amount, Coins, N1)) → U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_in_gga(NewAmount, .(s(C), Coins), N2))
U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_out_gga(NewAmount, .(s(C), Coins), N2)) → U8_gga(Amount, C, Coins, N, plus_in_gga(N1, N2, N))
plus_in_gga(0, X, X) → U2_gga(X, nat_in_g(X))
U2_gga(X, nat_out_g(X)) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U3_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U3_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U8_gga(Amount, C, Coins, N, plus_out_gga(N1, N2, N)) → ways_out_gga(Amount, .(s(C), Coins), N)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U9_gga(Amount, C, Coins, N, X, plus_in_gag(Amount, s(X1), s(C)))
U9_gga(Amount, C, Coins, N, X, plus_out_gag(Amount, s(X1), s(C))) → U10_gga(Amount, C, Coins, N, ways_in_gga(Amount, Coins, N))
U10_gga(Amount, C, Coins, N, ways_out_gga(Amount, Coins, N)) → ways_out_gga(Amount, .(s(C), Coins), N)

The argument filtering Pi contains the following mapping:
ways_in_gga(x1, x2, x3)  =  ways_in_gga(x1, x2)
0  =  0
ways_out_gga(x1, x2, x3)  =  ways_out_gga(x3)
[]  =  []
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
U4_gga(x1, x2, x3, x4, x5)  =  U4_gga(x1, x2, x3, x5)
=_in_ga(x1, x2)  =  =_in_ga(x1)
=_out_ga(x1, x2)  =  =_out_ga(x2)
U5_gga(x1, x2, x3, x4, x5, x6)  =  U5_gga(x1, x2, x3, x6)
plus_in_gag(x1, x2, x3)  =  plus_in_gag(x1, x3)
U2_gag(x1, x2)  =  U2_gag(x1, x2)
nat_in_g(x1)  =  nat_in_g(x1)
nat_out_g(x1)  =  nat_out_g
U1_g(x1, x2)  =  U1_g(x2)
plus_out_gag(x1, x2, x3)  =  plus_out_gag(x2)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x4)
U6_gga(x1, x2, x3, x4, x5, x6, x7)  =  U6_gga(x2, x3, x6, x7)
U7_gga(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_gga(x7, x8)
U8_gga(x1, x2, x3, x4, x5)  =  U8_gga(x5)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
U2_gga(x1, x2)  =  U2_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x4)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x3, x6)
U10_gga(x1, x2, x3, x4, x5)  =  U10_gga(x5)
PLUS_IN_GAG(x1, x2, x3)  =  PLUS_IN_GAG(x1, x3)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                    ↳ UsableRulesProof
PiDP
                        ↳ PiDPToQDPProof
                  ↳ PiDP
      ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

PLUS_IN_GAG(s(X), Y, s(Z)) → PLUS_IN_GAG(X, Y, Z)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
PLUS_IN_GAG(x1, x2, x3)  =  PLUS_IN_GAG(x1, x3)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                    ↳ UsableRulesProof
                      ↳ PiDP
                        ↳ PiDPToQDPProof
QDP
                            ↳ QDPSizeChangeProof
                  ↳ PiDP
      ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

PLUS_IN_GAG(s(X), s(Z)) → PLUS_IN_GAG(X, Z)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
PiDP
                    ↳ PiDPToQDPProof
      ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

U5_GGA(Amount, C, Coins, N, X, plus_out_gag(s(C), NewAmount, Amount)) → U6_GGA(Amount, C, Coins, N, X, NewAmount, ways_in_gga(Amount, Coins, N1))
WAYS_IN_GGA(Amount, .(s(C), Coins), N) → U4_GGA(Amount, C, Coins, N, =_in_ga(Amount, s(X)))
U6_GGA(Amount, C, Coins, N, X, NewAmount, ways_out_gga(Amount, Coins, N1)) → WAYS_IN_GGA(NewAmount, .(s(C), Coins), N2)
U4_GGA(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U5_GGA(Amount, C, Coins, N, X, plus_in_gag(s(C), NewAmount, Amount))
U5_GGA(Amount, C, Coins, N, X, plus_out_gag(s(C), NewAmount, Amount)) → WAYS_IN_GGA(Amount, Coins, N1)
U9_GGA(Amount, C, Coins, N, X, plus_out_gag(Amount, s(X1), s(C))) → WAYS_IN_GGA(Amount, Coins, N)
U4_GGA(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U9_GGA(Amount, C, Coins, N, X, plus_in_gag(Amount, s(X1), s(C)))

The TRS R consists of the following rules:

ways_in_gga(0, X, s(0)) → ways_out_gga(0, X, s(0))
ways_in_gga(X, [], 0) → ways_out_gga(X, [], 0)
ways_in_gga(Amount, .(s(C), Coins), N) → U4_gga(Amount, C, Coins, N, =_in_ga(Amount, s(X)))
=_in_ga(X, X) → =_out_ga(X, X)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U5_gga(Amount, C, Coins, N, X, plus_in_gag(s(C), NewAmount, Amount))
plus_in_gag(0, X, X) → U2_gag(X, nat_in_g(X))
nat_in_g(0) → nat_out_g(0)
nat_in_g(s(X)) → U1_g(X, nat_in_g(X))
U1_g(X, nat_out_g(X)) → nat_out_g(s(X))
U2_gag(X, nat_out_g(X)) → plus_out_gag(0, X, X)
plus_in_gag(s(X), Y, s(Z)) → U3_gag(X, Y, Z, plus_in_gag(X, Y, Z))
U3_gag(X, Y, Z, plus_out_gag(X, Y, Z)) → plus_out_gag(s(X), Y, s(Z))
U5_gga(Amount, C, Coins, N, X, plus_out_gag(s(C), NewAmount, Amount)) → U6_gga(Amount, C, Coins, N, X, NewAmount, ways_in_gga(Amount, Coins, N1))
U6_gga(Amount, C, Coins, N, X, NewAmount, ways_out_gga(Amount, Coins, N1)) → U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_in_gga(NewAmount, .(s(C), Coins), N2))
U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_out_gga(NewAmount, .(s(C), Coins), N2)) → U8_gga(Amount, C, Coins, N, plus_in_gga(N1, N2, N))
plus_in_gga(0, X, X) → U2_gga(X, nat_in_g(X))
U2_gga(X, nat_out_g(X)) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U3_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U3_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U8_gga(Amount, C, Coins, N, plus_out_gga(N1, N2, N)) → ways_out_gga(Amount, .(s(C), Coins), N)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U9_gga(Amount, C, Coins, N, X, plus_in_gag(Amount, s(X1), s(C)))
U9_gga(Amount, C, Coins, N, X, plus_out_gag(Amount, s(X1), s(C))) → U10_gga(Amount, C, Coins, N, ways_in_gga(Amount, Coins, N))
U10_gga(Amount, C, Coins, N, ways_out_gga(Amount, Coins, N)) → ways_out_gga(Amount, .(s(C), Coins), N)

The argument filtering Pi contains the following mapping:
ways_in_gga(x1, x2, x3)  =  ways_in_gga(x1, x2)
0  =  0
ways_out_gga(x1, x2, x3)  =  ways_out_gga(x3)
[]  =  []
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
U4_gga(x1, x2, x3, x4, x5)  =  U4_gga(x1, x2, x3, x5)
=_in_ga(x1, x2)  =  =_in_ga(x1)
=_out_ga(x1, x2)  =  =_out_ga(x2)
U5_gga(x1, x2, x3, x4, x5, x6)  =  U5_gga(x1, x2, x3, x6)
plus_in_gag(x1, x2, x3)  =  plus_in_gag(x1, x3)
U2_gag(x1, x2)  =  U2_gag(x1, x2)
nat_in_g(x1)  =  nat_in_g(x1)
nat_out_g(x1)  =  nat_out_g
U1_g(x1, x2)  =  U1_g(x2)
plus_out_gag(x1, x2, x3)  =  plus_out_gag(x2)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x4)
U6_gga(x1, x2, x3, x4, x5, x6, x7)  =  U6_gga(x2, x3, x6, x7)
U7_gga(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_gga(x7, x8)
U8_gga(x1, x2, x3, x4, x5)  =  U8_gga(x5)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
U2_gga(x1, x2)  =  U2_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x4)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x3, x6)
U10_gga(x1, x2, x3, x4, x5)  =  U10_gga(x5)
U4_GGA(x1, x2, x3, x4, x5)  =  U4_GGA(x1, x2, x3, x5)
U9_GGA(x1, x2, x3, x4, x5, x6)  =  U9_GGA(x1, x3, x6)
U6_GGA(x1, x2, x3, x4, x5, x6, x7)  =  U6_GGA(x2, x3, x6, x7)
U5_GGA(x1, x2, x3, x4, x5, x6)  =  U5_GGA(x1, x2, x3, x6)
WAYS_IN_GGA(x1, x2, x3)  =  WAYS_IN_GGA(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ Rewriting
      ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U4_GGA(Amount, C, Coins, =_out_ga(s(X))) → U5_GGA(Amount, C, Coins, plus_in_gag(s(C), Amount))
WAYS_IN_GGA(Amount, .(s(C), Coins)) → U4_GGA(Amount, C, Coins, =_in_ga(Amount))
U6_GGA(C, Coins, NewAmount, ways_out_gga(N1)) → WAYS_IN_GGA(NewAmount, .(s(C), Coins))
U5_GGA(Amount, C, Coins, plus_out_gag(NewAmount)) → U6_GGA(C, Coins, NewAmount, ways_in_gga(Amount, Coins))
U4_GGA(Amount, C, Coins, =_out_ga(s(X))) → U9_GGA(Amount, Coins, plus_in_gag(Amount, s(C)))
U5_GGA(Amount, C, Coins, plus_out_gag(NewAmount)) → WAYS_IN_GGA(Amount, Coins)
U9_GGA(Amount, Coins, plus_out_gag(s(X1))) → WAYS_IN_GGA(Amount, Coins)

The TRS R consists of the following rules:

ways_in_gga(0, X) → ways_out_gga(s(0))
ways_in_gga(X, []) → ways_out_gga(0)
ways_in_gga(Amount, .(s(C), Coins)) → U4_gga(Amount, C, Coins, =_in_ga(Amount))
=_in_ga(X) → =_out_ga(X)
U4_gga(Amount, C, Coins, =_out_ga(s(X))) → U5_gga(Amount, C, Coins, plus_in_gag(s(C), Amount))
plus_in_gag(0, X) → U2_gag(X, nat_in_g(X))
nat_in_g(0) → nat_out_g
nat_in_g(s(X)) → U1_g(nat_in_g(X))
U1_g(nat_out_g) → nat_out_g
U2_gag(X, nat_out_g) → plus_out_gag(X)
plus_in_gag(s(X), s(Z)) → U3_gag(plus_in_gag(X, Z))
U3_gag(plus_out_gag(Y)) → plus_out_gag(Y)
U5_gga(Amount, C, Coins, plus_out_gag(NewAmount)) → U6_gga(C, Coins, NewAmount, ways_in_gga(Amount, Coins))
U6_gga(C, Coins, NewAmount, ways_out_gga(N1)) → U7_gga(N1, ways_in_gga(NewAmount, .(s(C), Coins)))
U7_gga(N1, ways_out_gga(N2)) → U8_gga(plus_in_gga(N1, N2))
plus_in_gga(0, X) → U2_gga(X, nat_in_g(X))
U2_gga(X, nat_out_g) → plus_out_gga(X)
plus_in_gga(s(X), Y) → U3_gga(plus_in_gga(X, Y))
U3_gga(plus_out_gga(Z)) → plus_out_gga(s(Z))
U8_gga(plus_out_gga(N)) → ways_out_gga(N)
U4_gga(Amount, C, Coins, =_out_ga(s(X))) → U9_gga(Amount, Coins, plus_in_gag(Amount, s(C)))
U9_gga(Amount, Coins, plus_out_gag(s(X1))) → U10_gga(ways_in_gga(Amount, Coins))
U10_gga(ways_out_gga(N)) → ways_out_gga(N)

The set Q consists of the following terms:

ways_in_gga(x0, x1)
=_in_ga(x0)
U4_gga(x0, x1, x2, x3)
plus_in_gag(x0, x1)
nat_in_g(x0)
U1_g(x0)
U2_gag(x0, x1)
U3_gag(x0)
U5_gga(x0, x1, x2, x3)
U6_gga(x0, x1, x2, x3)
U7_gga(x0, x1)
plus_in_gga(x0, x1)
U2_gga(x0, x1)
U3_gga(x0)
U8_gga(x0)
U9_gga(x0, x1, x2)
U10_gga(x0)

We have to consider all (P,Q,R)-chains.
By rewriting [15] the rule WAYS_IN_GGA(Amount, .(s(C), Coins)) → U4_GGA(Amount, C, Coins, =_in_ga(Amount)) at position [3] we obtained the following new rules:

WAYS_IN_GGA(Amount, .(s(C), Coins)) → U4_GGA(Amount, C, Coins, =_out_ga(Amount))



↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Rewriting
QDP
                            ↳ Instantiation
      ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U4_GGA(Amount, C, Coins, =_out_ga(s(X))) → U5_GGA(Amount, C, Coins, plus_in_gag(s(C), Amount))
WAYS_IN_GGA(Amount, .(s(C), Coins)) → U4_GGA(Amount, C, Coins, =_out_ga(Amount))
U6_GGA(C, Coins, NewAmount, ways_out_gga(N1)) → WAYS_IN_GGA(NewAmount, .(s(C), Coins))
U5_GGA(Amount, C, Coins, plus_out_gag(NewAmount)) → U6_GGA(C, Coins, NewAmount, ways_in_gga(Amount, Coins))
U4_GGA(Amount, C, Coins, =_out_ga(s(X))) → U9_GGA(Amount, Coins, plus_in_gag(Amount, s(C)))
U5_GGA(Amount, C, Coins, plus_out_gag(NewAmount)) → WAYS_IN_GGA(Amount, Coins)
U9_GGA(Amount, Coins, plus_out_gag(s(X1))) → WAYS_IN_GGA(Amount, Coins)

The TRS R consists of the following rules:

ways_in_gga(0, X) → ways_out_gga(s(0))
ways_in_gga(X, []) → ways_out_gga(0)
ways_in_gga(Amount, .(s(C), Coins)) → U4_gga(Amount, C, Coins, =_in_ga(Amount))
=_in_ga(X) → =_out_ga(X)
U4_gga(Amount, C, Coins, =_out_ga(s(X))) → U5_gga(Amount, C, Coins, plus_in_gag(s(C), Amount))
plus_in_gag(0, X) → U2_gag(X, nat_in_g(X))
nat_in_g(0) → nat_out_g
nat_in_g(s(X)) → U1_g(nat_in_g(X))
U1_g(nat_out_g) → nat_out_g
U2_gag(X, nat_out_g) → plus_out_gag(X)
plus_in_gag(s(X), s(Z)) → U3_gag(plus_in_gag(X, Z))
U3_gag(plus_out_gag(Y)) → plus_out_gag(Y)
U5_gga(Amount, C, Coins, plus_out_gag(NewAmount)) → U6_gga(C, Coins, NewAmount, ways_in_gga(Amount, Coins))
U6_gga(C, Coins, NewAmount, ways_out_gga(N1)) → U7_gga(N1, ways_in_gga(NewAmount, .(s(C), Coins)))
U7_gga(N1, ways_out_gga(N2)) → U8_gga(plus_in_gga(N1, N2))
plus_in_gga(0, X) → U2_gga(X, nat_in_g(X))
U2_gga(X, nat_out_g) → plus_out_gga(X)
plus_in_gga(s(X), Y) → U3_gga(plus_in_gga(X, Y))
U3_gga(plus_out_gga(Z)) → plus_out_gga(s(Z))
U8_gga(plus_out_gga(N)) → ways_out_gga(N)
U4_gga(Amount, C, Coins, =_out_ga(s(X))) → U9_gga(Amount, Coins, plus_in_gag(Amount, s(C)))
U9_gga(Amount, Coins, plus_out_gag(s(X1))) → U10_gga(ways_in_gga(Amount, Coins))
U10_gga(ways_out_gga(N)) → ways_out_gga(N)

The set Q consists of the following terms:

ways_in_gga(x0, x1)
=_in_ga(x0)
U4_gga(x0, x1, x2, x3)
plus_in_gag(x0, x1)
nat_in_g(x0)
U1_g(x0)
U2_gag(x0, x1)
U3_gag(x0)
U5_gga(x0, x1, x2, x3)
U6_gga(x0, x1, x2, x3)
U7_gga(x0, x1)
plus_in_gga(x0, x1)
U2_gga(x0, x1)
U3_gga(x0)
U8_gga(x0)
U9_gga(x0, x1, x2)
U10_gga(x0)

We have to consider all (P,Q,R)-chains.
By instantiating [15] the rule U4_GGA(Amount, C, Coins, =_out_ga(s(X))) → U5_GGA(Amount, C, Coins, plus_in_gag(s(C), Amount)) we obtained the following new rules:

U4_GGA(s(x3), z1, z2, =_out_ga(s(x3))) → U5_GGA(s(x3), z1, z2, plus_in_gag(s(z1), s(x3)))



↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Rewriting
                          ↳ QDP
                            ↳ Instantiation
QDP
                                ↳ Rewriting
      ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

WAYS_IN_GGA(Amount, .(s(C), Coins)) → U4_GGA(Amount, C, Coins, =_out_ga(Amount))
U6_GGA(C, Coins, NewAmount, ways_out_gga(N1)) → WAYS_IN_GGA(NewAmount, .(s(C), Coins))
U5_GGA(Amount, C, Coins, plus_out_gag(NewAmount)) → U6_GGA(C, Coins, NewAmount, ways_in_gga(Amount, Coins))
U4_GGA(Amount, C, Coins, =_out_ga(s(X))) → U9_GGA(Amount, Coins, plus_in_gag(Amount, s(C)))
U5_GGA(Amount, C, Coins, plus_out_gag(NewAmount)) → WAYS_IN_GGA(Amount, Coins)
U9_GGA(Amount, Coins, plus_out_gag(s(X1))) → WAYS_IN_GGA(Amount, Coins)
U4_GGA(s(x3), z1, z2, =_out_ga(s(x3))) → U5_GGA(s(x3), z1, z2, plus_in_gag(s(z1), s(x3)))

The TRS R consists of the following rules:

ways_in_gga(0, X) → ways_out_gga(s(0))
ways_in_gga(X, []) → ways_out_gga(0)
ways_in_gga(Amount, .(s(C), Coins)) → U4_gga(Amount, C, Coins, =_in_ga(Amount))
=_in_ga(X) → =_out_ga(X)
U4_gga(Amount, C, Coins, =_out_ga(s(X))) → U5_gga(Amount, C, Coins, plus_in_gag(s(C), Amount))
plus_in_gag(0, X) → U2_gag(X, nat_in_g(X))
nat_in_g(0) → nat_out_g
nat_in_g(s(X)) → U1_g(nat_in_g(X))
U1_g(nat_out_g) → nat_out_g
U2_gag(X, nat_out_g) → plus_out_gag(X)
plus_in_gag(s(X), s(Z)) → U3_gag(plus_in_gag(X, Z))
U3_gag(plus_out_gag(Y)) → plus_out_gag(Y)
U5_gga(Amount, C, Coins, plus_out_gag(NewAmount)) → U6_gga(C, Coins, NewAmount, ways_in_gga(Amount, Coins))
U6_gga(C, Coins, NewAmount, ways_out_gga(N1)) → U7_gga(N1, ways_in_gga(NewAmount, .(s(C), Coins)))
U7_gga(N1, ways_out_gga(N2)) → U8_gga(plus_in_gga(N1, N2))
plus_in_gga(0, X) → U2_gga(X, nat_in_g(X))
U2_gga(X, nat_out_g) → plus_out_gga(X)
plus_in_gga(s(X), Y) → U3_gga(plus_in_gga(X, Y))
U3_gga(plus_out_gga(Z)) → plus_out_gga(s(Z))
U8_gga(plus_out_gga(N)) → ways_out_gga(N)
U4_gga(Amount, C, Coins, =_out_ga(s(X))) → U9_gga(Amount, Coins, plus_in_gag(Amount, s(C)))
U9_gga(Amount, Coins, plus_out_gag(s(X1))) → U10_gga(ways_in_gga(Amount, Coins))
U10_gga(ways_out_gga(N)) → ways_out_gga(N)

The set Q consists of the following terms:

ways_in_gga(x0, x1)
=_in_ga(x0)
U4_gga(x0, x1, x2, x3)
plus_in_gag(x0, x1)
nat_in_g(x0)
U1_g(x0)
U2_gag(x0, x1)
U3_gag(x0)
U5_gga(x0, x1, x2, x3)
U6_gga(x0, x1, x2, x3)
U7_gga(x0, x1)
plus_in_gga(x0, x1)
U2_gga(x0, x1)
U3_gga(x0)
U8_gga(x0)
U9_gga(x0, x1, x2)
U10_gga(x0)

We have to consider all (P,Q,R)-chains.
By rewriting [15] the rule U4_GGA(s(x3), z1, z2, =_out_ga(s(x3))) → U5_GGA(s(x3), z1, z2, plus_in_gag(s(z1), s(x3))) at position [3] we obtained the following new rules:

U4_GGA(s(x3), z1, z2, =_out_ga(s(x3))) → U5_GGA(s(x3), z1, z2, U3_gag(plus_in_gag(z1, x3)))



↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Rewriting
                          ↳ QDP
                            ↳ Instantiation
                              ↳ QDP
                                ↳ Rewriting
QDP
                                    ↳ Instantiation
      ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

WAYS_IN_GGA(Amount, .(s(C), Coins)) → U4_GGA(Amount, C, Coins, =_out_ga(Amount))
U6_GGA(C, Coins, NewAmount, ways_out_gga(N1)) → WAYS_IN_GGA(NewAmount, .(s(C), Coins))
U5_GGA(Amount, C, Coins, plus_out_gag(NewAmount)) → U6_GGA(C, Coins, NewAmount, ways_in_gga(Amount, Coins))
U4_GGA(Amount, C, Coins, =_out_ga(s(X))) → U9_GGA(Amount, Coins, plus_in_gag(Amount, s(C)))
U5_GGA(Amount, C, Coins, plus_out_gag(NewAmount)) → WAYS_IN_GGA(Amount, Coins)
U4_GGA(s(x3), z1, z2, =_out_ga(s(x3))) → U5_GGA(s(x3), z1, z2, U3_gag(plus_in_gag(z1, x3)))
U9_GGA(Amount, Coins, plus_out_gag(s(X1))) → WAYS_IN_GGA(Amount, Coins)

The TRS R consists of the following rules:

ways_in_gga(0, X) → ways_out_gga(s(0))
ways_in_gga(X, []) → ways_out_gga(0)
ways_in_gga(Amount, .(s(C), Coins)) → U4_gga(Amount, C, Coins, =_in_ga(Amount))
=_in_ga(X) → =_out_ga(X)
U4_gga(Amount, C, Coins, =_out_ga(s(X))) → U5_gga(Amount, C, Coins, plus_in_gag(s(C), Amount))
plus_in_gag(0, X) → U2_gag(X, nat_in_g(X))
nat_in_g(0) → nat_out_g
nat_in_g(s(X)) → U1_g(nat_in_g(X))
U1_g(nat_out_g) → nat_out_g
U2_gag(X, nat_out_g) → plus_out_gag(X)
plus_in_gag(s(X), s(Z)) → U3_gag(plus_in_gag(X, Z))
U3_gag(plus_out_gag(Y)) → plus_out_gag(Y)
U5_gga(Amount, C, Coins, plus_out_gag(NewAmount)) → U6_gga(C, Coins, NewAmount, ways_in_gga(Amount, Coins))
U6_gga(C, Coins, NewAmount, ways_out_gga(N1)) → U7_gga(N1, ways_in_gga(NewAmount, .(s(C), Coins)))
U7_gga(N1, ways_out_gga(N2)) → U8_gga(plus_in_gga(N1, N2))
plus_in_gga(0, X) → U2_gga(X, nat_in_g(X))
U2_gga(X, nat_out_g) → plus_out_gga(X)
plus_in_gga(s(X), Y) → U3_gga(plus_in_gga(X, Y))
U3_gga(plus_out_gga(Z)) → plus_out_gga(s(Z))
U8_gga(plus_out_gga(N)) → ways_out_gga(N)
U4_gga(Amount, C, Coins, =_out_ga(s(X))) → U9_gga(Amount, Coins, plus_in_gag(Amount, s(C)))
U9_gga(Amount, Coins, plus_out_gag(s(X1))) → U10_gga(ways_in_gga(Amount, Coins))
U10_gga(ways_out_gga(N)) → ways_out_gga(N)

The set Q consists of the following terms:

ways_in_gga(x0, x1)
=_in_ga(x0)
U4_gga(x0, x1, x2, x3)
plus_in_gag(x0, x1)
nat_in_g(x0)
U1_g(x0)
U2_gag(x0, x1)
U3_gag(x0)
U5_gga(x0, x1, x2, x3)
U6_gga(x0, x1, x2, x3)
U7_gga(x0, x1)
plus_in_gga(x0, x1)
U2_gga(x0, x1)
U3_gga(x0)
U8_gga(x0)
U9_gga(x0, x1, x2)
U10_gga(x0)

We have to consider all (P,Q,R)-chains.
By instantiating [15] the rule U4_GGA(Amount, C, Coins, =_out_ga(s(X))) → U9_GGA(Amount, Coins, plus_in_gag(Amount, s(C))) we obtained the following new rules:

U4_GGA(s(x3), z1, z2, =_out_ga(s(x3))) → U9_GGA(s(x3), z2, plus_in_gag(s(x3), s(z1)))



↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Rewriting
                          ↳ QDP
                            ↳ Instantiation
                              ↳ QDP
                                ↳ Rewriting
                                  ↳ QDP
                                    ↳ Instantiation
QDP
                                        ↳ Rewriting
      ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U4_GGA(s(x3), z1, z2, =_out_ga(s(x3))) → U9_GGA(s(x3), z2, plus_in_gag(s(x3), s(z1)))
WAYS_IN_GGA(Amount, .(s(C), Coins)) → U4_GGA(Amount, C, Coins, =_out_ga(Amount))
U6_GGA(C, Coins, NewAmount, ways_out_gga(N1)) → WAYS_IN_GGA(NewAmount, .(s(C), Coins))
U5_GGA(Amount, C, Coins, plus_out_gag(NewAmount)) → U6_GGA(C, Coins, NewAmount, ways_in_gga(Amount, Coins))
U5_GGA(Amount, C, Coins, plus_out_gag(NewAmount)) → WAYS_IN_GGA(Amount, Coins)
U9_GGA(Amount, Coins, plus_out_gag(s(X1))) → WAYS_IN_GGA(Amount, Coins)
U4_GGA(s(x3), z1, z2, =_out_ga(s(x3))) → U5_GGA(s(x3), z1, z2, U3_gag(plus_in_gag(z1, x3)))

The TRS R consists of the following rules:

ways_in_gga(0, X) → ways_out_gga(s(0))
ways_in_gga(X, []) → ways_out_gga(0)
ways_in_gga(Amount, .(s(C), Coins)) → U4_gga(Amount, C, Coins, =_in_ga(Amount))
=_in_ga(X) → =_out_ga(X)
U4_gga(Amount, C, Coins, =_out_ga(s(X))) → U5_gga(Amount, C, Coins, plus_in_gag(s(C), Amount))
plus_in_gag(0, X) → U2_gag(X, nat_in_g(X))
nat_in_g(0) → nat_out_g
nat_in_g(s(X)) → U1_g(nat_in_g(X))
U1_g(nat_out_g) → nat_out_g
U2_gag(X, nat_out_g) → plus_out_gag(X)
plus_in_gag(s(X), s(Z)) → U3_gag(plus_in_gag(X, Z))
U3_gag(plus_out_gag(Y)) → plus_out_gag(Y)
U5_gga(Amount, C, Coins, plus_out_gag(NewAmount)) → U6_gga(C, Coins, NewAmount, ways_in_gga(Amount, Coins))
U6_gga(C, Coins, NewAmount, ways_out_gga(N1)) → U7_gga(N1, ways_in_gga(NewAmount, .(s(C), Coins)))
U7_gga(N1, ways_out_gga(N2)) → U8_gga(plus_in_gga(N1, N2))
plus_in_gga(0, X) → U2_gga(X, nat_in_g(X))
U2_gga(X, nat_out_g) → plus_out_gga(X)
plus_in_gga(s(X), Y) → U3_gga(plus_in_gga(X, Y))
U3_gga(plus_out_gga(Z)) → plus_out_gga(s(Z))
U8_gga(plus_out_gga(N)) → ways_out_gga(N)
U4_gga(Amount, C, Coins, =_out_ga(s(X))) → U9_gga(Amount, Coins, plus_in_gag(Amount, s(C)))
U9_gga(Amount, Coins, plus_out_gag(s(X1))) → U10_gga(ways_in_gga(Amount, Coins))
U10_gga(ways_out_gga(N)) → ways_out_gga(N)

The set Q consists of the following terms:

ways_in_gga(x0, x1)
=_in_ga(x0)
U4_gga(x0, x1, x2, x3)
plus_in_gag(x0, x1)
nat_in_g(x0)
U1_g(x0)
U2_gag(x0, x1)
U3_gag(x0)
U5_gga(x0, x1, x2, x3)
U6_gga(x0, x1, x2, x3)
U7_gga(x0, x1)
plus_in_gga(x0, x1)
U2_gga(x0, x1)
U3_gga(x0)
U8_gga(x0)
U9_gga(x0, x1, x2)
U10_gga(x0)

We have to consider all (P,Q,R)-chains.
By rewriting [15] the rule U4_GGA(s(x3), z1, z2, =_out_ga(s(x3))) → U9_GGA(s(x3), z2, plus_in_gag(s(x3), s(z1))) at position [2] we obtained the following new rules:

U4_GGA(s(x3), z1, z2, =_out_ga(s(x3))) → U9_GGA(s(x3), z2, U3_gag(plus_in_gag(x3, z1)))



↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Rewriting
                          ↳ QDP
                            ↳ Instantiation
                              ↳ QDP
                                ↳ Rewriting
                                  ↳ QDP
                                    ↳ Instantiation
                                      ↳ QDP
                                        ↳ Rewriting
QDP
                                            ↳ QDPOrderProof
      ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U4_GGA(s(x3), z1, z2, =_out_ga(s(x3))) → U9_GGA(s(x3), z2, U3_gag(plus_in_gag(x3, z1)))
WAYS_IN_GGA(Amount, .(s(C), Coins)) → U4_GGA(Amount, C, Coins, =_out_ga(Amount))
U6_GGA(C, Coins, NewAmount, ways_out_gga(N1)) → WAYS_IN_GGA(NewAmount, .(s(C), Coins))
U5_GGA(Amount, C, Coins, plus_out_gag(NewAmount)) → U6_GGA(C, Coins, NewAmount, ways_in_gga(Amount, Coins))
U5_GGA(Amount, C, Coins, plus_out_gag(NewAmount)) → WAYS_IN_GGA(Amount, Coins)
U4_GGA(s(x3), z1, z2, =_out_ga(s(x3))) → U5_GGA(s(x3), z1, z2, U3_gag(plus_in_gag(z1, x3)))
U9_GGA(Amount, Coins, plus_out_gag(s(X1))) → WAYS_IN_GGA(Amount, Coins)

The TRS R consists of the following rules:

ways_in_gga(0, X) → ways_out_gga(s(0))
ways_in_gga(X, []) → ways_out_gga(0)
ways_in_gga(Amount, .(s(C), Coins)) → U4_gga(Amount, C, Coins, =_in_ga(Amount))
=_in_ga(X) → =_out_ga(X)
U4_gga(Amount, C, Coins, =_out_ga(s(X))) → U5_gga(Amount, C, Coins, plus_in_gag(s(C), Amount))
plus_in_gag(0, X) → U2_gag(X, nat_in_g(X))
nat_in_g(0) → nat_out_g
nat_in_g(s(X)) → U1_g(nat_in_g(X))
U1_g(nat_out_g) → nat_out_g
U2_gag(X, nat_out_g) → plus_out_gag(X)
plus_in_gag(s(X), s(Z)) → U3_gag(plus_in_gag(X, Z))
U3_gag(plus_out_gag(Y)) → plus_out_gag(Y)
U5_gga(Amount, C, Coins, plus_out_gag(NewAmount)) → U6_gga(C, Coins, NewAmount, ways_in_gga(Amount, Coins))
U6_gga(C, Coins, NewAmount, ways_out_gga(N1)) → U7_gga(N1, ways_in_gga(NewAmount, .(s(C), Coins)))
U7_gga(N1, ways_out_gga(N2)) → U8_gga(plus_in_gga(N1, N2))
plus_in_gga(0, X) → U2_gga(X, nat_in_g(X))
U2_gga(X, nat_out_g) → plus_out_gga(X)
plus_in_gga(s(X), Y) → U3_gga(plus_in_gga(X, Y))
U3_gga(plus_out_gga(Z)) → plus_out_gga(s(Z))
U8_gga(plus_out_gga(N)) → ways_out_gga(N)
U4_gga(Amount, C, Coins, =_out_ga(s(X))) → U9_gga(Amount, Coins, plus_in_gag(Amount, s(C)))
U9_gga(Amount, Coins, plus_out_gag(s(X1))) → U10_gga(ways_in_gga(Amount, Coins))
U10_gga(ways_out_gga(N)) → ways_out_gga(N)

The set Q consists of the following terms:

ways_in_gga(x0, x1)
=_in_ga(x0)
U4_gga(x0, x1, x2, x3)
plus_in_gag(x0, x1)
nat_in_g(x0)
U1_g(x0)
U2_gag(x0, x1)
U3_gag(x0)
U5_gga(x0, x1, x2, x3)
U6_gga(x0, x1, x2, x3)
U7_gga(x0, x1)
plus_in_gga(x0, x1)
U2_gga(x0, x1)
U3_gga(x0)
U8_gga(x0)
U9_gga(x0, x1, x2)
U10_gga(x0)

We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


U5_GGA(Amount, C, Coins, plus_out_gag(NewAmount)) → WAYS_IN_GGA(Amount, Coins)
U9_GGA(Amount, Coins, plus_out_gag(s(X1))) → WAYS_IN_GGA(Amount, Coins)
The remaining pairs can at least be oriented weakly.

U4_GGA(s(x3), z1, z2, =_out_ga(s(x3))) → U9_GGA(s(x3), z2, U3_gag(plus_in_gag(x3, z1)))
WAYS_IN_GGA(Amount, .(s(C), Coins)) → U4_GGA(Amount, C, Coins, =_out_ga(Amount))
U6_GGA(C, Coins, NewAmount, ways_out_gga(N1)) → WAYS_IN_GGA(NewAmount, .(s(C), Coins))
U5_GGA(Amount, C, Coins, plus_out_gag(NewAmount)) → U6_GGA(C, Coins, NewAmount, ways_in_gga(Amount, Coins))
U4_GGA(s(x3), z1, z2, =_out_ga(s(x3))) → U5_GGA(s(x3), z1, z2, U3_gag(plus_in_gag(z1, x3)))
Used ordering: Polynomial interpretation [25]:

POL(.(x1, x2)) = 1 + x2   
POL(0) = 1   
POL(=_in_ga(x1)) = 1 + x1   
POL(=_out_ga(x1)) = 0   
POL(U10_gga(x1)) = 0   
POL(U1_g(x1)) = 0   
POL(U2_gag(x1, x2)) = 0   
POL(U2_gga(x1, x2)) = 1   
POL(U3_gag(x1)) = 0   
POL(U3_gga(x1)) = 1   
POL(U4_GGA(x1, x2, x3, x4)) = 1 + x3   
POL(U4_gga(x1, x2, x3, x4)) = 0   
POL(U5_GGA(x1, x2, x3, x4)) = 1 + x3   
POL(U5_gga(x1, x2, x3, x4)) = 0   
POL(U6_GGA(x1, x2, x3, x4)) = 1 + x2   
POL(U6_gga(x1, x2, x3, x4)) = 0   
POL(U7_gga(x1, x2)) = 0   
POL(U8_gga(x1)) = 0   
POL(U9_GGA(x1, x2, x3)) = 1 + x2   
POL(U9_gga(x1, x2, x3)) = 0   
POL(WAYS_IN_GGA(x1, x2)) = x2   
POL([]) = 0   
POL(nat_in_g(x1)) = 0   
POL(nat_out_g) = 0   
POL(plus_in_gag(x1, x2)) = 0   
POL(plus_in_gga(x1, x2)) = 1 + x1 + x2   
POL(plus_out_gag(x1)) = 0   
POL(plus_out_gga(x1)) = 0   
POL(s(x1)) = 0   
POL(ways_in_gga(x1, x2)) = 0   
POL(ways_out_gga(x1)) = 0   

The following usable rules [17] were oriented: none



↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Rewriting
                          ↳ QDP
                            ↳ Instantiation
                              ↳ QDP
                                ↳ Rewriting
                                  ↳ QDP
                                    ↳ Instantiation
                                      ↳ QDP
                                        ↳ Rewriting
                                          ↳ QDP
                                            ↳ QDPOrderProof
QDP
                                                ↳ DependencyGraphProof
      ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U4_GGA(s(x3), z1, z2, =_out_ga(s(x3))) → U9_GGA(s(x3), z2, U3_gag(plus_in_gag(x3, z1)))
WAYS_IN_GGA(Amount, .(s(C), Coins)) → U4_GGA(Amount, C, Coins, =_out_ga(Amount))
U6_GGA(C, Coins, NewAmount, ways_out_gga(N1)) → WAYS_IN_GGA(NewAmount, .(s(C), Coins))
U5_GGA(Amount, C, Coins, plus_out_gag(NewAmount)) → U6_GGA(C, Coins, NewAmount, ways_in_gga(Amount, Coins))
U4_GGA(s(x3), z1, z2, =_out_ga(s(x3))) → U5_GGA(s(x3), z1, z2, U3_gag(plus_in_gag(z1, x3)))

The TRS R consists of the following rules:

ways_in_gga(0, X) → ways_out_gga(s(0))
ways_in_gga(X, []) → ways_out_gga(0)
ways_in_gga(Amount, .(s(C), Coins)) → U4_gga(Amount, C, Coins, =_in_ga(Amount))
=_in_ga(X) → =_out_ga(X)
U4_gga(Amount, C, Coins, =_out_ga(s(X))) → U5_gga(Amount, C, Coins, plus_in_gag(s(C), Amount))
plus_in_gag(0, X) → U2_gag(X, nat_in_g(X))
nat_in_g(0) → nat_out_g
nat_in_g(s(X)) → U1_g(nat_in_g(X))
U1_g(nat_out_g) → nat_out_g
U2_gag(X, nat_out_g) → plus_out_gag(X)
plus_in_gag(s(X), s(Z)) → U3_gag(plus_in_gag(X, Z))
U3_gag(plus_out_gag(Y)) → plus_out_gag(Y)
U5_gga(Amount, C, Coins, plus_out_gag(NewAmount)) → U6_gga(C, Coins, NewAmount, ways_in_gga(Amount, Coins))
U6_gga(C, Coins, NewAmount, ways_out_gga(N1)) → U7_gga(N1, ways_in_gga(NewAmount, .(s(C), Coins)))
U7_gga(N1, ways_out_gga(N2)) → U8_gga(plus_in_gga(N1, N2))
plus_in_gga(0, X) → U2_gga(X, nat_in_g(X))
U2_gga(X, nat_out_g) → plus_out_gga(X)
plus_in_gga(s(X), Y) → U3_gga(plus_in_gga(X, Y))
U3_gga(plus_out_gga(Z)) → plus_out_gga(s(Z))
U8_gga(plus_out_gga(N)) → ways_out_gga(N)
U4_gga(Amount, C, Coins, =_out_ga(s(X))) → U9_gga(Amount, Coins, plus_in_gag(Amount, s(C)))
U9_gga(Amount, Coins, plus_out_gag(s(X1))) → U10_gga(ways_in_gga(Amount, Coins))
U10_gga(ways_out_gga(N)) → ways_out_gga(N)

The set Q consists of the following terms:

ways_in_gga(x0, x1)
=_in_ga(x0)
U4_gga(x0, x1, x2, x3)
plus_in_gag(x0, x1)
nat_in_g(x0)
U1_g(x0)
U2_gag(x0, x1)
U3_gag(x0)
U5_gga(x0, x1, x2, x3)
U6_gga(x0, x1, x2, x3)
U7_gga(x0, x1)
plus_in_gga(x0, x1)
U2_gga(x0, x1)
U3_gga(x0)
U8_gga(x0)
U9_gga(x0, x1, x2)
U10_gga(x0)

We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Rewriting
                          ↳ QDP
                            ↳ Instantiation
                              ↳ QDP
                                ↳ Rewriting
                                  ↳ QDP
                                    ↳ Instantiation
                                      ↳ QDP
                                        ↳ Rewriting
                                          ↳ QDP
                                            ↳ QDPOrderProof
                                              ↳ QDP
                                                ↳ DependencyGraphProof
QDP
                                                    ↳ QDPOrderProof
      ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

WAYS_IN_GGA(Amount, .(s(C), Coins)) → U4_GGA(Amount, C, Coins, =_out_ga(Amount))
U6_GGA(C, Coins, NewAmount, ways_out_gga(N1)) → WAYS_IN_GGA(NewAmount, .(s(C), Coins))
U5_GGA(Amount, C, Coins, plus_out_gag(NewAmount)) → U6_GGA(C, Coins, NewAmount, ways_in_gga(Amount, Coins))
U4_GGA(s(x3), z1, z2, =_out_ga(s(x3))) → U5_GGA(s(x3), z1, z2, U3_gag(plus_in_gag(z1, x3)))

The TRS R consists of the following rules:

ways_in_gga(0, X) → ways_out_gga(s(0))
ways_in_gga(X, []) → ways_out_gga(0)
ways_in_gga(Amount, .(s(C), Coins)) → U4_gga(Amount, C, Coins, =_in_ga(Amount))
=_in_ga(X) → =_out_ga(X)
U4_gga(Amount, C, Coins, =_out_ga(s(X))) → U5_gga(Amount, C, Coins, plus_in_gag(s(C), Amount))
plus_in_gag(0, X) → U2_gag(X, nat_in_g(X))
nat_in_g(0) → nat_out_g
nat_in_g(s(X)) → U1_g(nat_in_g(X))
U1_g(nat_out_g) → nat_out_g
U2_gag(X, nat_out_g) → plus_out_gag(X)
plus_in_gag(s(X), s(Z)) → U3_gag(plus_in_gag(X, Z))
U3_gag(plus_out_gag(Y)) → plus_out_gag(Y)
U5_gga(Amount, C, Coins, plus_out_gag(NewAmount)) → U6_gga(C, Coins, NewAmount, ways_in_gga(Amount, Coins))
U6_gga(C, Coins, NewAmount, ways_out_gga(N1)) → U7_gga(N1, ways_in_gga(NewAmount, .(s(C), Coins)))
U7_gga(N1, ways_out_gga(N2)) → U8_gga(plus_in_gga(N1, N2))
plus_in_gga(0, X) → U2_gga(X, nat_in_g(X))
U2_gga(X, nat_out_g) → plus_out_gga(X)
plus_in_gga(s(X), Y) → U3_gga(plus_in_gga(X, Y))
U3_gga(plus_out_gga(Z)) → plus_out_gga(s(Z))
U8_gga(plus_out_gga(N)) → ways_out_gga(N)
U4_gga(Amount, C, Coins, =_out_ga(s(X))) → U9_gga(Amount, Coins, plus_in_gag(Amount, s(C)))
U9_gga(Amount, Coins, plus_out_gag(s(X1))) → U10_gga(ways_in_gga(Amount, Coins))
U10_gga(ways_out_gga(N)) → ways_out_gga(N)

The set Q consists of the following terms:

ways_in_gga(x0, x1)
=_in_ga(x0)
U4_gga(x0, x1, x2, x3)
plus_in_gag(x0, x1)
nat_in_g(x0)
U1_g(x0)
U2_gag(x0, x1)
U3_gag(x0)
U5_gga(x0, x1, x2, x3)
U6_gga(x0, x1, x2, x3)
U7_gga(x0, x1)
plus_in_gga(x0, x1)
U2_gga(x0, x1)
U3_gga(x0)
U8_gga(x0)
U9_gga(x0, x1, x2)
U10_gga(x0)

We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


U6_GGA(C, Coins, NewAmount, ways_out_gga(N1)) → WAYS_IN_GGA(NewAmount, .(s(C), Coins))
The remaining pairs can at least be oriented weakly.

WAYS_IN_GGA(Amount, .(s(C), Coins)) → U4_GGA(Amount, C, Coins, =_out_ga(Amount))
U5_GGA(Amount, C, Coins, plus_out_gag(NewAmount)) → U6_GGA(C, Coins, NewAmount, ways_in_gga(Amount, Coins))
U4_GGA(s(x3), z1, z2, =_out_ga(s(x3))) → U5_GGA(s(x3), z1, z2, U3_gag(plus_in_gag(z1, x3)))
Used ordering: Polynomial interpretation [25]:

POL(.(x1, x2)) = 0   
POL(0) = 0   
POL(=_in_ga(x1)) = 0   
POL(=_out_ga(x1)) = 0   
POL(U10_gga(x1)) = x1   
POL(U1_g(x1)) = 0   
POL(U2_gag(x1, x2)) = 1 + x1   
POL(U2_gga(x1, x2)) = 0   
POL(U3_gag(x1)) = x1   
POL(U3_gga(x1)) = 1   
POL(U4_GGA(x1, x2, x3, x4)) = 1 + x1   
POL(U4_gga(x1, x2, x3, x4)) = 1   
POL(U5_GGA(x1, x2, x3, x4)) = 1 + x4   
POL(U5_gga(x1, x2, x3, x4)) = 1   
POL(U6_GGA(x1, x2, x3, x4)) = 1 + x3 + x4   
POL(U6_gga(x1, x2, x3, x4)) = 1   
POL(U7_gga(x1, x2)) = 1   
POL(U8_gga(x1)) = 1   
POL(U9_gga(x1, x2, x3)) = 1   
POL(WAYS_IN_GGA(x1, x2)) = 1 + x1   
POL([]) = 0   
POL(nat_in_g(x1)) = 0   
POL(nat_out_g) = 0   
POL(plus_in_gag(x1, x2)) = 1 + x2   
POL(plus_in_gga(x1, x2)) = 1 + x1 + x2   
POL(plus_out_gag(x1)) = 1 + x1   
POL(plus_out_gga(x1)) = 0   
POL(s(x1)) = 1 + x1   
POL(ways_in_gga(x1, x2)) = 1   
POL(ways_out_gga(x1)) = 1   

The following usable rules [17] were oriented:

U9_gga(Amount, Coins, plus_out_gag(s(X1))) → U10_gga(ways_in_gga(Amount, Coins))
U5_gga(Amount, C, Coins, plus_out_gag(NewAmount)) → U6_gga(C, Coins, NewAmount, ways_in_gga(Amount, Coins))
ways_in_gga(Amount, .(s(C), Coins)) → U4_gga(Amount, C, Coins, =_in_ga(Amount))
U10_gga(ways_out_gga(N)) → ways_out_gga(N)
U3_gag(plus_out_gag(Y)) → plus_out_gag(Y)
plus_in_gag(s(X), s(Z)) → U3_gag(plus_in_gag(X, Z))
ways_in_gga(0, X) → ways_out_gga(s(0))
U8_gga(plus_out_gga(N)) → ways_out_gga(N)
U4_gga(Amount, C, Coins, =_out_ga(s(X))) → U5_gga(Amount, C, Coins, plus_in_gag(s(C), Amount))
U7_gga(N1, ways_out_gga(N2)) → U8_gga(plus_in_gga(N1, N2))
U2_gag(X, nat_out_g) → plus_out_gag(X)
plus_in_gag(0, X) → U2_gag(X, nat_in_g(X))
ways_in_gga(X, []) → ways_out_gga(0)
U6_gga(C, Coins, NewAmount, ways_out_gga(N1)) → U7_gga(N1, ways_in_gga(NewAmount, .(s(C), Coins)))
U4_gga(Amount, C, Coins, =_out_ga(s(X))) → U9_gga(Amount, Coins, plus_in_gag(Amount, s(C)))



↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Rewriting
                          ↳ QDP
                            ↳ Instantiation
                              ↳ QDP
                                ↳ Rewriting
                                  ↳ QDP
                                    ↳ Instantiation
                                      ↳ QDP
                                        ↳ Rewriting
                                          ↳ QDP
                                            ↳ QDPOrderProof
                                              ↳ QDP
                                                ↳ DependencyGraphProof
                                                  ↳ QDP
                                                    ↳ QDPOrderProof
QDP
                                                        ↳ DependencyGraphProof
      ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

WAYS_IN_GGA(Amount, .(s(C), Coins)) → U4_GGA(Amount, C, Coins, =_out_ga(Amount))
U5_GGA(Amount, C, Coins, plus_out_gag(NewAmount)) → U6_GGA(C, Coins, NewAmount, ways_in_gga(Amount, Coins))
U4_GGA(s(x3), z1, z2, =_out_ga(s(x3))) → U5_GGA(s(x3), z1, z2, U3_gag(plus_in_gag(z1, x3)))

The TRS R consists of the following rules:

ways_in_gga(0, X) → ways_out_gga(s(0))
ways_in_gga(X, []) → ways_out_gga(0)
ways_in_gga(Amount, .(s(C), Coins)) → U4_gga(Amount, C, Coins, =_in_ga(Amount))
=_in_ga(X) → =_out_ga(X)
U4_gga(Amount, C, Coins, =_out_ga(s(X))) → U5_gga(Amount, C, Coins, plus_in_gag(s(C), Amount))
plus_in_gag(0, X) → U2_gag(X, nat_in_g(X))
nat_in_g(0) → nat_out_g
nat_in_g(s(X)) → U1_g(nat_in_g(X))
U1_g(nat_out_g) → nat_out_g
U2_gag(X, nat_out_g) → plus_out_gag(X)
plus_in_gag(s(X), s(Z)) → U3_gag(plus_in_gag(X, Z))
U3_gag(plus_out_gag(Y)) → plus_out_gag(Y)
U5_gga(Amount, C, Coins, plus_out_gag(NewAmount)) → U6_gga(C, Coins, NewAmount, ways_in_gga(Amount, Coins))
U6_gga(C, Coins, NewAmount, ways_out_gga(N1)) → U7_gga(N1, ways_in_gga(NewAmount, .(s(C), Coins)))
U7_gga(N1, ways_out_gga(N2)) → U8_gga(plus_in_gga(N1, N2))
plus_in_gga(0, X) → U2_gga(X, nat_in_g(X))
U2_gga(X, nat_out_g) → plus_out_gga(X)
plus_in_gga(s(X), Y) → U3_gga(plus_in_gga(X, Y))
U3_gga(plus_out_gga(Z)) → plus_out_gga(s(Z))
U8_gga(plus_out_gga(N)) → ways_out_gga(N)
U4_gga(Amount, C, Coins, =_out_ga(s(X))) → U9_gga(Amount, Coins, plus_in_gag(Amount, s(C)))
U9_gga(Amount, Coins, plus_out_gag(s(X1))) → U10_gga(ways_in_gga(Amount, Coins))
U10_gga(ways_out_gga(N)) → ways_out_gga(N)

The set Q consists of the following terms:

ways_in_gga(x0, x1)
=_in_ga(x0)
U4_gga(x0, x1, x2, x3)
plus_in_gag(x0, x1)
nat_in_g(x0)
U1_g(x0)
U2_gag(x0, x1)
U3_gag(x0)
U5_gga(x0, x1, x2, x3)
U6_gga(x0, x1, x2, x3)
U7_gga(x0, x1)
plus_in_gga(x0, x1)
U2_gga(x0, x1)
U3_gga(x0)
U8_gga(x0)
U9_gga(x0, x1, x2)
U10_gga(x0)

We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 0 SCCs with 3 less nodes.
We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
ways_in: (b,b,f)
plus_in: (b,f,b) (b,b,f)
nat_in: (b)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

ways_in_gga(0, X, s(0)) → ways_out_gga(0, X, s(0))
ways_in_gga(X, [], 0) → ways_out_gga(X, [], 0)
ways_in_gga(Amount, .(s(C), Coins), N) → U4_gga(Amount, C, Coins, N, =_in_ga(Amount, s(X)))
=_in_ga(X, X) → =_out_ga(X, X)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U5_gga(Amount, C, Coins, N, X, plus_in_gag(s(C), NewAmount, Amount))
plus_in_gag(0, X, X) → U2_gag(X, nat_in_g(X))
nat_in_g(0) → nat_out_g(0)
nat_in_g(s(X)) → U1_g(X, nat_in_g(X))
U1_g(X, nat_out_g(X)) → nat_out_g(s(X))
U2_gag(X, nat_out_g(X)) → plus_out_gag(0, X, X)
plus_in_gag(s(X), Y, s(Z)) → U3_gag(X, Y, Z, plus_in_gag(X, Y, Z))
U3_gag(X, Y, Z, plus_out_gag(X, Y, Z)) → plus_out_gag(s(X), Y, s(Z))
U5_gga(Amount, C, Coins, N, X, plus_out_gag(s(C), NewAmount, Amount)) → U6_gga(Amount, C, Coins, N, X, NewAmount, ways_in_gga(Amount, Coins, N1))
U6_gga(Amount, C, Coins, N, X, NewAmount, ways_out_gga(Amount, Coins, N1)) → U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_in_gga(NewAmount, .(s(C), Coins), N2))
U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_out_gga(NewAmount, .(s(C), Coins), N2)) → U8_gga(Amount, C, Coins, N, plus_in_gga(N1, N2, N))
plus_in_gga(0, X, X) → U2_gga(X, nat_in_g(X))
U2_gga(X, nat_out_g(X)) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U3_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U3_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U8_gga(Amount, C, Coins, N, plus_out_gga(N1, N2, N)) → ways_out_gga(Amount, .(s(C), Coins), N)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U9_gga(Amount, C, Coins, N, X, plus_in_gag(Amount, s(X1), s(C)))
U9_gga(Amount, C, Coins, N, X, plus_out_gag(Amount, s(X1), s(C))) → U10_gga(Amount, C, Coins, N, ways_in_gga(Amount, Coins, N))
U10_gga(Amount, C, Coins, N, ways_out_gga(Amount, Coins, N)) → ways_out_gga(Amount, .(s(C), Coins), N)

The argument filtering Pi contains the following mapping:
ways_in_gga(x1, x2, x3)  =  ways_in_gga(x1, x2)
0  =  0
ways_out_gga(x1, x2, x3)  =  ways_out_gga(x1, x2, x3)
[]  =  []
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
U4_gga(x1, x2, x3, x4, x5)  =  U4_gga(x1, x2, x3, x5)
=_in_ga(x1, x2)  =  =_in_ga(x1)
=_out_ga(x1, x2)  =  =_out_ga(x1, x2)
U5_gga(x1, x2, x3, x4, x5, x6)  =  U5_gga(x1, x2, x3, x6)
plus_in_gag(x1, x2, x3)  =  plus_in_gag(x1, x3)
U2_gag(x1, x2)  =  U2_gag(x1, x2)
nat_in_g(x1)  =  nat_in_g(x1)
nat_out_g(x1)  =  nat_out_g(x1)
U1_g(x1, x2)  =  U1_g(x1, x2)
plus_out_gag(x1, x2, x3)  =  plus_out_gag(x1, x2, x3)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x1, x3, x4)
U6_gga(x1, x2, x3, x4, x5, x6, x7)  =  U6_gga(x1, x2, x3, x6, x7)
U7_gga(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_gga(x1, x2, x3, x7, x8)
U8_gga(x1, x2, x3, x4, x5)  =  U8_gga(x1, x2, x3, x5)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
U2_gga(x1, x2)  =  U2_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x1, x2, x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x6)
U10_gga(x1, x2, x3, x4, x5)  =  U10_gga(x1, x2, x3, x5)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
      ↳ PrologToPiTRSProof
PiTRS
          ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

ways_in_gga(0, X, s(0)) → ways_out_gga(0, X, s(0))
ways_in_gga(X, [], 0) → ways_out_gga(X, [], 0)
ways_in_gga(Amount, .(s(C), Coins), N) → U4_gga(Amount, C, Coins, N, =_in_ga(Amount, s(X)))
=_in_ga(X, X) → =_out_ga(X, X)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U5_gga(Amount, C, Coins, N, X, plus_in_gag(s(C), NewAmount, Amount))
plus_in_gag(0, X, X) → U2_gag(X, nat_in_g(X))
nat_in_g(0) → nat_out_g(0)
nat_in_g(s(X)) → U1_g(X, nat_in_g(X))
U1_g(X, nat_out_g(X)) → nat_out_g(s(X))
U2_gag(X, nat_out_g(X)) → plus_out_gag(0, X, X)
plus_in_gag(s(X), Y, s(Z)) → U3_gag(X, Y, Z, plus_in_gag(X, Y, Z))
U3_gag(X, Y, Z, plus_out_gag(X, Y, Z)) → plus_out_gag(s(X), Y, s(Z))
U5_gga(Amount, C, Coins, N, X, plus_out_gag(s(C), NewAmount, Amount)) → U6_gga(Amount, C, Coins, N, X, NewAmount, ways_in_gga(Amount, Coins, N1))
U6_gga(Amount, C, Coins, N, X, NewAmount, ways_out_gga(Amount, Coins, N1)) → U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_in_gga(NewAmount, .(s(C), Coins), N2))
U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_out_gga(NewAmount, .(s(C), Coins), N2)) → U8_gga(Amount, C, Coins, N, plus_in_gga(N1, N2, N))
plus_in_gga(0, X, X) → U2_gga(X, nat_in_g(X))
U2_gga(X, nat_out_g(X)) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U3_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U3_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U8_gga(Amount, C, Coins, N, plus_out_gga(N1, N2, N)) → ways_out_gga(Amount, .(s(C), Coins), N)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U9_gga(Amount, C, Coins, N, X, plus_in_gag(Amount, s(X1), s(C)))
U9_gga(Amount, C, Coins, N, X, plus_out_gag(Amount, s(X1), s(C))) → U10_gga(Amount, C, Coins, N, ways_in_gga(Amount, Coins, N))
U10_gga(Amount, C, Coins, N, ways_out_gga(Amount, Coins, N)) → ways_out_gga(Amount, .(s(C), Coins), N)

The argument filtering Pi contains the following mapping:
ways_in_gga(x1, x2, x3)  =  ways_in_gga(x1, x2)
0  =  0
ways_out_gga(x1, x2, x3)  =  ways_out_gga(x1, x2, x3)
[]  =  []
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
U4_gga(x1, x2, x3, x4, x5)  =  U4_gga(x1, x2, x3, x5)
=_in_ga(x1, x2)  =  =_in_ga(x1)
=_out_ga(x1, x2)  =  =_out_ga(x1, x2)
U5_gga(x1, x2, x3, x4, x5, x6)  =  U5_gga(x1, x2, x3, x6)
plus_in_gag(x1, x2, x3)  =  plus_in_gag(x1, x3)
U2_gag(x1, x2)  =  U2_gag(x1, x2)
nat_in_g(x1)  =  nat_in_g(x1)
nat_out_g(x1)  =  nat_out_g(x1)
U1_g(x1, x2)  =  U1_g(x1, x2)
plus_out_gag(x1, x2, x3)  =  plus_out_gag(x1, x2, x3)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x1, x3, x4)
U6_gga(x1, x2, x3, x4, x5, x6, x7)  =  U6_gga(x1, x2, x3, x6, x7)
U7_gga(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_gga(x1, x2, x3, x7, x8)
U8_gga(x1, x2, x3, x4, x5)  =  U8_gga(x1, x2, x3, x5)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
U2_gga(x1, x2)  =  U2_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x1, x2, x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x6)
U10_gga(x1, x2, x3, x4, x5)  =  U10_gga(x1, x2, x3, x5)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

WAYS_IN_GGA(Amount, .(s(C), Coins), N) → U4_GGA(Amount, C, Coins, N, =_in_ga(Amount, s(X)))
WAYS_IN_GGA(Amount, .(s(C), Coins), N) → =_IN_GA(Amount, s(X))
U4_GGA(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U5_GGA(Amount, C, Coins, N, X, plus_in_gag(s(C), NewAmount, Amount))
U4_GGA(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → PLUS_IN_GAG(s(C), NewAmount, Amount)
PLUS_IN_GAG(0, X, X) → U2_GAG(X, nat_in_g(X))
PLUS_IN_GAG(0, X, X) → NAT_IN_G(X)
NAT_IN_G(s(X)) → U1_G(X, nat_in_g(X))
NAT_IN_G(s(X)) → NAT_IN_G(X)
PLUS_IN_GAG(s(X), Y, s(Z)) → U3_GAG(X, Y, Z, plus_in_gag(X, Y, Z))
PLUS_IN_GAG(s(X), Y, s(Z)) → PLUS_IN_GAG(X, Y, Z)
U5_GGA(Amount, C, Coins, N, X, plus_out_gag(s(C), NewAmount, Amount)) → U6_GGA(Amount, C, Coins, N, X, NewAmount, ways_in_gga(Amount, Coins, N1))
U5_GGA(Amount, C, Coins, N, X, plus_out_gag(s(C), NewAmount, Amount)) → WAYS_IN_GGA(Amount, Coins, N1)
U6_GGA(Amount, C, Coins, N, X, NewAmount, ways_out_gga(Amount, Coins, N1)) → U7_GGA(Amount, C, Coins, N, X, NewAmount, N1, ways_in_gga(NewAmount, .(s(C), Coins), N2))
U6_GGA(Amount, C, Coins, N, X, NewAmount, ways_out_gga(Amount, Coins, N1)) → WAYS_IN_GGA(NewAmount, .(s(C), Coins), N2)
U7_GGA(Amount, C, Coins, N, X, NewAmount, N1, ways_out_gga(NewAmount, .(s(C), Coins), N2)) → U8_GGA(Amount, C, Coins, N, plus_in_gga(N1, N2, N))
U7_GGA(Amount, C, Coins, N, X, NewAmount, N1, ways_out_gga(NewAmount, .(s(C), Coins), N2)) → PLUS_IN_GGA(N1, N2, N)
PLUS_IN_GGA(0, X, X) → U2_GGA(X, nat_in_g(X))
PLUS_IN_GGA(0, X, X) → NAT_IN_G(X)
PLUS_IN_GGA(s(X), Y, s(Z)) → U3_GGA(X, Y, Z, plus_in_gga(X, Y, Z))
PLUS_IN_GGA(s(X), Y, s(Z)) → PLUS_IN_GGA(X, Y, Z)
U4_GGA(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U9_GGA(Amount, C, Coins, N, X, plus_in_gag(Amount, s(X1), s(C)))
U4_GGA(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → PLUS_IN_GAG(Amount, s(X1), s(C))
U9_GGA(Amount, C, Coins, N, X, plus_out_gag(Amount, s(X1), s(C))) → U10_GGA(Amount, C, Coins, N, ways_in_gga(Amount, Coins, N))
U9_GGA(Amount, C, Coins, N, X, plus_out_gag(Amount, s(X1), s(C))) → WAYS_IN_GGA(Amount, Coins, N)

The TRS R consists of the following rules:

ways_in_gga(0, X, s(0)) → ways_out_gga(0, X, s(0))
ways_in_gga(X, [], 0) → ways_out_gga(X, [], 0)
ways_in_gga(Amount, .(s(C), Coins), N) → U4_gga(Amount, C, Coins, N, =_in_ga(Amount, s(X)))
=_in_ga(X, X) → =_out_ga(X, X)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U5_gga(Amount, C, Coins, N, X, plus_in_gag(s(C), NewAmount, Amount))
plus_in_gag(0, X, X) → U2_gag(X, nat_in_g(X))
nat_in_g(0) → nat_out_g(0)
nat_in_g(s(X)) → U1_g(X, nat_in_g(X))
U1_g(X, nat_out_g(X)) → nat_out_g(s(X))
U2_gag(X, nat_out_g(X)) → plus_out_gag(0, X, X)
plus_in_gag(s(X), Y, s(Z)) → U3_gag(X, Y, Z, plus_in_gag(X, Y, Z))
U3_gag(X, Y, Z, plus_out_gag(X, Y, Z)) → plus_out_gag(s(X), Y, s(Z))
U5_gga(Amount, C, Coins, N, X, plus_out_gag(s(C), NewAmount, Amount)) → U6_gga(Amount, C, Coins, N, X, NewAmount, ways_in_gga(Amount, Coins, N1))
U6_gga(Amount, C, Coins, N, X, NewAmount, ways_out_gga(Amount, Coins, N1)) → U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_in_gga(NewAmount, .(s(C), Coins), N2))
U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_out_gga(NewAmount, .(s(C), Coins), N2)) → U8_gga(Amount, C, Coins, N, plus_in_gga(N1, N2, N))
plus_in_gga(0, X, X) → U2_gga(X, nat_in_g(X))
U2_gga(X, nat_out_g(X)) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U3_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U3_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U8_gga(Amount, C, Coins, N, plus_out_gga(N1, N2, N)) → ways_out_gga(Amount, .(s(C), Coins), N)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U9_gga(Amount, C, Coins, N, X, plus_in_gag(Amount, s(X1), s(C)))
U9_gga(Amount, C, Coins, N, X, plus_out_gag(Amount, s(X1), s(C))) → U10_gga(Amount, C, Coins, N, ways_in_gga(Amount, Coins, N))
U10_gga(Amount, C, Coins, N, ways_out_gga(Amount, Coins, N)) → ways_out_gga(Amount, .(s(C), Coins), N)

The argument filtering Pi contains the following mapping:
ways_in_gga(x1, x2, x3)  =  ways_in_gga(x1, x2)
0  =  0
ways_out_gga(x1, x2, x3)  =  ways_out_gga(x1, x2, x3)
[]  =  []
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
U4_gga(x1, x2, x3, x4, x5)  =  U4_gga(x1, x2, x3, x5)
=_in_ga(x1, x2)  =  =_in_ga(x1)
=_out_ga(x1, x2)  =  =_out_ga(x1, x2)
U5_gga(x1, x2, x3, x4, x5, x6)  =  U5_gga(x1, x2, x3, x6)
plus_in_gag(x1, x2, x3)  =  plus_in_gag(x1, x3)
U2_gag(x1, x2)  =  U2_gag(x1, x2)
nat_in_g(x1)  =  nat_in_g(x1)
nat_out_g(x1)  =  nat_out_g(x1)
U1_g(x1, x2)  =  U1_g(x1, x2)
plus_out_gag(x1, x2, x3)  =  plus_out_gag(x1, x2, x3)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x1, x3, x4)
U6_gga(x1, x2, x3, x4, x5, x6, x7)  =  U6_gga(x1, x2, x3, x6, x7)
U7_gga(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_gga(x1, x2, x3, x7, x8)
U8_gga(x1, x2, x3, x4, x5)  =  U8_gga(x1, x2, x3, x5)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
U2_gga(x1, x2)  =  U2_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x1, x2, x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x6)
U10_gga(x1, x2, x3, x4, x5)  =  U10_gga(x1, x2, x3, x5)
NAT_IN_G(x1)  =  NAT_IN_G(x1)
U3_GAG(x1, x2, x3, x4)  =  U3_GAG(x1, x3, x4)
U7_GGA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_GGA(x1, x2, x3, x7, x8)
U4_GGA(x1, x2, x3, x4, x5)  =  U4_GGA(x1, x2, x3, x5)
U2_GGA(x1, x2)  =  U2_GGA(x1, x2)
U1_G(x1, x2)  =  U1_G(x1, x2)
U2_GAG(x1, x2)  =  U2_GAG(x1, x2)
U8_GGA(x1, x2, x3, x4, x5)  =  U8_GGA(x1, x2, x3, x5)
PLUS_IN_GAG(x1, x2, x3)  =  PLUS_IN_GAG(x1, x3)
U10_GGA(x1, x2, x3, x4, x5)  =  U10_GGA(x1, x2, x3, x5)
U9_GGA(x1, x2, x3, x4, x5, x6)  =  U9_GGA(x1, x2, x3, x6)
U6_GGA(x1, x2, x3, x4, x5, x6, x7)  =  U6_GGA(x1, x2, x3, x6, x7)
PLUS_IN_GGA(x1, x2, x3)  =  PLUS_IN_GGA(x1, x2)
=_IN_GA(x1, x2)  =  =_IN_GA(x1)
U5_GGA(x1, x2, x3, x4, x5, x6)  =  U5_GGA(x1, x2, x3, x6)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x1, x2, x4)
WAYS_IN_GGA(x1, x2, x3)  =  WAYS_IN_GGA(x1, x2)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
PiDP
              ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

WAYS_IN_GGA(Amount, .(s(C), Coins), N) → U4_GGA(Amount, C, Coins, N, =_in_ga(Amount, s(X)))
WAYS_IN_GGA(Amount, .(s(C), Coins), N) → =_IN_GA(Amount, s(X))
U4_GGA(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U5_GGA(Amount, C, Coins, N, X, plus_in_gag(s(C), NewAmount, Amount))
U4_GGA(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → PLUS_IN_GAG(s(C), NewAmount, Amount)
PLUS_IN_GAG(0, X, X) → U2_GAG(X, nat_in_g(X))
PLUS_IN_GAG(0, X, X) → NAT_IN_G(X)
NAT_IN_G(s(X)) → U1_G(X, nat_in_g(X))
NAT_IN_G(s(X)) → NAT_IN_G(X)
PLUS_IN_GAG(s(X), Y, s(Z)) → U3_GAG(X, Y, Z, plus_in_gag(X, Y, Z))
PLUS_IN_GAG(s(X), Y, s(Z)) → PLUS_IN_GAG(X, Y, Z)
U5_GGA(Amount, C, Coins, N, X, plus_out_gag(s(C), NewAmount, Amount)) → U6_GGA(Amount, C, Coins, N, X, NewAmount, ways_in_gga(Amount, Coins, N1))
U5_GGA(Amount, C, Coins, N, X, plus_out_gag(s(C), NewAmount, Amount)) → WAYS_IN_GGA(Amount, Coins, N1)
U6_GGA(Amount, C, Coins, N, X, NewAmount, ways_out_gga(Amount, Coins, N1)) → U7_GGA(Amount, C, Coins, N, X, NewAmount, N1, ways_in_gga(NewAmount, .(s(C), Coins), N2))
U6_GGA(Amount, C, Coins, N, X, NewAmount, ways_out_gga(Amount, Coins, N1)) → WAYS_IN_GGA(NewAmount, .(s(C), Coins), N2)
U7_GGA(Amount, C, Coins, N, X, NewAmount, N1, ways_out_gga(NewAmount, .(s(C), Coins), N2)) → U8_GGA(Amount, C, Coins, N, plus_in_gga(N1, N2, N))
U7_GGA(Amount, C, Coins, N, X, NewAmount, N1, ways_out_gga(NewAmount, .(s(C), Coins), N2)) → PLUS_IN_GGA(N1, N2, N)
PLUS_IN_GGA(0, X, X) → U2_GGA(X, nat_in_g(X))
PLUS_IN_GGA(0, X, X) → NAT_IN_G(X)
PLUS_IN_GGA(s(X), Y, s(Z)) → U3_GGA(X, Y, Z, plus_in_gga(X, Y, Z))
PLUS_IN_GGA(s(X), Y, s(Z)) → PLUS_IN_GGA(X, Y, Z)
U4_GGA(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U9_GGA(Amount, C, Coins, N, X, plus_in_gag(Amount, s(X1), s(C)))
U4_GGA(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → PLUS_IN_GAG(Amount, s(X1), s(C))
U9_GGA(Amount, C, Coins, N, X, plus_out_gag(Amount, s(X1), s(C))) → U10_GGA(Amount, C, Coins, N, ways_in_gga(Amount, Coins, N))
U9_GGA(Amount, C, Coins, N, X, plus_out_gag(Amount, s(X1), s(C))) → WAYS_IN_GGA(Amount, Coins, N)

The TRS R consists of the following rules:

ways_in_gga(0, X, s(0)) → ways_out_gga(0, X, s(0))
ways_in_gga(X, [], 0) → ways_out_gga(X, [], 0)
ways_in_gga(Amount, .(s(C), Coins), N) → U4_gga(Amount, C, Coins, N, =_in_ga(Amount, s(X)))
=_in_ga(X, X) → =_out_ga(X, X)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U5_gga(Amount, C, Coins, N, X, plus_in_gag(s(C), NewAmount, Amount))
plus_in_gag(0, X, X) → U2_gag(X, nat_in_g(X))
nat_in_g(0) → nat_out_g(0)
nat_in_g(s(X)) → U1_g(X, nat_in_g(X))
U1_g(X, nat_out_g(X)) → nat_out_g(s(X))
U2_gag(X, nat_out_g(X)) → plus_out_gag(0, X, X)
plus_in_gag(s(X), Y, s(Z)) → U3_gag(X, Y, Z, plus_in_gag(X, Y, Z))
U3_gag(X, Y, Z, plus_out_gag(X, Y, Z)) → plus_out_gag(s(X), Y, s(Z))
U5_gga(Amount, C, Coins, N, X, plus_out_gag(s(C), NewAmount, Amount)) → U6_gga(Amount, C, Coins, N, X, NewAmount, ways_in_gga(Amount, Coins, N1))
U6_gga(Amount, C, Coins, N, X, NewAmount, ways_out_gga(Amount, Coins, N1)) → U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_in_gga(NewAmount, .(s(C), Coins), N2))
U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_out_gga(NewAmount, .(s(C), Coins), N2)) → U8_gga(Amount, C, Coins, N, plus_in_gga(N1, N2, N))
plus_in_gga(0, X, X) → U2_gga(X, nat_in_g(X))
U2_gga(X, nat_out_g(X)) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U3_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U3_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U8_gga(Amount, C, Coins, N, plus_out_gga(N1, N2, N)) → ways_out_gga(Amount, .(s(C), Coins), N)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U9_gga(Amount, C, Coins, N, X, plus_in_gag(Amount, s(X1), s(C)))
U9_gga(Amount, C, Coins, N, X, plus_out_gag(Amount, s(X1), s(C))) → U10_gga(Amount, C, Coins, N, ways_in_gga(Amount, Coins, N))
U10_gga(Amount, C, Coins, N, ways_out_gga(Amount, Coins, N)) → ways_out_gga(Amount, .(s(C), Coins), N)

The argument filtering Pi contains the following mapping:
ways_in_gga(x1, x2, x3)  =  ways_in_gga(x1, x2)
0  =  0
ways_out_gga(x1, x2, x3)  =  ways_out_gga(x1, x2, x3)
[]  =  []
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
U4_gga(x1, x2, x3, x4, x5)  =  U4_gga(x1, x2, x3, x5)
=_in_ga(x1, x2)  =  =_in_ga(x1)
=_out_ga(x1, x2)  =  =_out_ga(x1, x2)
U5_gga(x1, x2, x3, x4, x5, x6)  =  U5_gga(x1, x2, x3, x6)
plus_in_gag(x1, x2, x3)  =  plus_in_gag(x1, x3)
U2_gag(x1, x2)  =  U2_gag(x1, x2)
nat_in_g(x1)  =  nat_in_g(x1)
nat_out_g(x1)  =  nat_out_g(x1)
U1_g(x1, x2)  =  U1_g(x1, x2)
plus_out_gag(x1, x2, x3)  =  plus_out_gag(x1, x2, x3)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x1, x3, x4)
U6_gga(x1, x2, x3, x4, x5, x6, x7)  =  U6_gga(x1, x2, x3, x6, x7)
U7_gga(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_gga(x1, x2, x3, x7, x8)
U8_gga(x1, x2, x3, x4, x5)  =  U8_gga(x1, x2, x3, x5)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
U2_gga(x1, x2)  =  U2_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x1, x2, x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x6)
U10_gga(x1, x2, x3, x4, x5)  =  U10_gga(x1, x2, x3, x5)
NAT_IN_G(x1)  =  NAT_IN_G(x1)
U3_GAG(x1, x2, x3, x4)  =  U3_GAG(x1, x3, x4)
U7_GGA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_GGA(x1, x2, x3, x7, x8)
U4_GGA(x1, x2, x3, x4, x5)  =  U4_GGA(x1, x2, x3, x5)
U2_GGA(x1, x2)  =  U2_GGA(x1, x2)
U1_G(x1, x2)  =  U1_G(x1, x2)
U2_GAG(x1, x2)  =  U2_GAG(x1, x2)
U8_GGA(x1, x2, x3, x4, x5)  =  U8_GGA(x1, x2, x3, x5)
PLUS_IN_GAG(x1, x2, x3)  =  PLUS_IN_GAG(x1, x3)
U10_GGA(x1, x2, x3, x4, x5)  =  U10_GGA(x1, x2, x3, x5)
U9_GGA(x1, x2, x3, x4, x5, x6)  =  U9_GGA(x1, x2, x3, x6)
U6_GGA(x1, x2, x3, x4, x5, x6, x7)  =  U6_GGA(x1, x2, x3, x6, x7)
PLUS_IN_GGA(x1, x2, x3)  =  PLUS_IN_GGA(x1, x2)
=_IN_GA(x1, x2)  =  =_IN_GA(x1)
U5_GGA(x1, x2, x3, x4, x5, x6)  =  U5_GGA(x1, x2, x3, x6)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x1, x2, x4)
WAYS_IN_GGA(x1, x2, x3)  =  WAYS_IN_GGA(x1, x2)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 4 SCCs with 14 less nodes.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
PiDP
                    ↳ UsableRulesProof
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

NAT_IN_G(s(X)) → NAT_IN_G(X)

The TRS R consists of the following rules:

ways_in_gga(0, X, s(0)) → ways_out_gga(0, X, s(0))
ways_in_gga(X, [], 0) → ways_out_gga(X, [], 0)
ways_in_gga(Amount, .(s(C), Coins), N) → U4_gga(Amount, C, Coins, N, =_in_ga(Amount, s(X)))
=_in_ga(X, X) → =_out_ga(X, X)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U5_gga(Amount, C, Coins, N, X, plus_in_gag(s(C), NewAmount, Amount))
plus_in_gag(0, X, X) → U2_gag(X, nat_in_g(X))
nat_in_g(0) → nat_out_g(0)
nat_in_g(s(X)) → U1_g(X, nat_in_g(X))
U1_g(X, nat_out_g(X)) → nat_out_g(s(X))
U2_gag(X, nat_out_g(X)) → plus_out_gag(0, X, X)
plus_in_gag(s(X), Y, s(Z)) → U3_gag(X, Y, Z, plus_in_gag(X, Y, Z))
U3_gag(X, Y, Z, plus_out_gag(X, Y, Z)) → plus_out_gag(s(X), Y, s(Z))
U5_gga(Amount, C, Coins, N, X, plus_out_gag(s(C), NewAmount, Amount)) → U6_gga(Amount, C, Coins, N, X, NewAmount, ways_in_gga(Amount, Coins, N1))
U6_gga(Amount, C, Coins, N, X, NewAmount, ways_out_gga(Amount, Coins, N1)) → U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_in_gga(NewAmount, .(s(C), Coins), N2))
U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_out_gga(NewAmount, .(s(C), Coins), N2)) → U8_gga(Amount, C, Coins, N, plus_in_gga(N1, N2, N))
plus_in_gga(0, X, X) → U2_gga(X, nat_in_g(X))
U2_gga(X, nat_out_g(X)) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U3_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U3_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U8_gga(Amount, C, Coins, N, plus_out_gga(N1, N2, N)) → ways_out_gga(Amount, .(s(C), Coins), N)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U9_gga(Amount, C, Coins, N, X, plus_in_gag(Amount, s(X1), s(C)))
U9_gga(Amount, C, Coins, N, X, plus_out_gag(Amount, s(X1), s(C))) → U10_gga(Amount, C, Coins, N, ways_in_gga(Amount, Coins, N))
U10_gga(Amount, C, Coins, N, ways_out_gga(Amount, Coins, N)) → ways_out_gga(Amount, .(s(C), Coins), N)

The argument filtering Pi contains the following mapping:
ways_in_gga(x1, x2, x3)  =  ways_in_gga(x1, x2)
0  =  0
ways_out_gga(x1, x2, x3)  =  ways_out_gga(x1, x2, x3)
[]  =  []
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
U4_gga(x1, x2, x3, x4, x5)  =  U4_gga(x1, x2, x3, x5)
=_in_ga(x1, x2)  =  =_in_ga(x1)
=_out_ga(x1, x2)  =  =_out_ga(x1, x2)
U5_gga(x1, x2, x3, x4, x5, x6)  =  U5_gga(x1, x2, x3, x6)
plus_in_gag(x1, x2, x3)  =  plus_in_gag(x1, x3)
U2_gag(x1, x2)  =  U2_gag(x1, x2)
nat_in_g(x1)  =  nat_in_g(x1)
nat_out_g(x1)  =  nat_out_g(x1)
U1_g(x1, x2)  =  U1_g(x1, x2)
plus_out_gag(x1, x2, x3)  =  plus_out_gag(x1, x2, x3)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x1, x3, x4)
U6_gga(x1, x2, x3, x4, x5, x6, x7)  =  U6_gga(x1, x2, x3, x6, x7)
U7_gga(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_gga(x1, x2, x3, x7, x8)
U8_gga(x1, x2, x3, x4, x5)  =  U8_gga(x1, x2, x3, x5)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
U2_gga(x1, x2)  =  U2_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x1, x2, x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x6)
U10_gga(x1, x2, x3, x4, x5)  =  U10_gga(x1, x2, x3, x5)
NAT_IN_G(x1)  =  NAT_IN_G(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                    ↳ UsableRulesProof
PiDP
                        ↳ PiDPToQDPProof
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

NAT_IN_G(s(X)) → NAT_IN_G(X)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                    ↳ UsableRulesProof
                      ↳ PiDP
                        ↳ PiDPToQDPProof
QDP
                            ↳ QDPSizeChangeProof
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

NAT_IN_G(s(X)) → NAT_IN_G(X)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
PiDP
                    ↳ UsableRulesProof
                  ↳ PiDP
                  ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

PLUS_IN_GGA(s(X), Y, s(Z)) → PLUS_IN_GGA(X, Y, Z)

The TRS R consists of the following rules:

ways_in_gga(0, X, s(0)) → ways_out_gga(0, X, s(0))
ways_in_gga(X, [], 0) → ways_out_gga(X, [], 0)
ways_in_gga(Amount, .(s(C), Coins), N) → U4_gga(Amount, C, Coins, N, =_in_ga(Amount, s(X)))
=_in_ga(X, X) → =_out_ga(X, X)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U5_gga(Amount, C, Coins, N, X, plus_in_gag(s(C), NewAmount, Amount))
plus_in_gag(0, X, X) → U2_gag(X, nat_in_g(X))
nat_in_g(0) → nat_out_g(0)
nat_in_g(s(X)) → U1_g(X, nat_in_g(X))
U1_g(X, nat_out_g(X)) → nat_out_g(s(X))
U2_gag(X, nat_out_g(X)) → plus_out_gag(0, X, X)
plus_in_gag(s(X), Y, s(Z)) → U3_gag(X, Y, Z, plus_in_gag(X, Y, Z))
U3_gag(X, Y, Z, plus_out_gag(X, Y, Z)) → plus_out_gag(s(X), Y, s(Z))
U5_gga(Amount, C, Coins, N, X, plus_out_gag(s(C), NewAmount, Amount)) → U6_gga(Amount, C, Coins, N, X, NewAmount, ways_in_gga(Amount, Coins, N1))
U6_gga(Amount, C, Coins, N, X, NewAmount, ways_out_gga(Amount, Coins, N1)) → U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_in_gga(NewAmount, .(s(C), Coins), N2))
U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_out_gga(NewAmount, .(s(C), Coins), N2)) → U8_gga(Amount, C, Coins, N, plus_in_gga(N1, N2, N))
plus_in_gga(0, X, X) → U2_gga(X, nat_in_g(X))
U2_gga(X, nat_out_g(X)) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U3_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U3_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U8_gga(Amount, C, Coins, N, plus_out_gga(N1, N2, N)) → ways_out_gga(Amount, .(s(C), Coins), N)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U9_gga(Amount, C, Coins, N, X, plus_in_gag(Amount, s(X1), s(C)))
U9_gga(Amount, C, Coins, N, X, plus_out_gag(Amount, s(X1), s(C))) → U10_gga(Amount, C, Coins, N, ways_in_gga(Amount, Coins, N))
U10_gga(Amount, C, Coins, N, ways_out_gga(Amount, Coins, N)) → ways_out_gga(Amount, .(s(C), Coins), N)

The argument filtering Pi contains the following mapping:
ways_in_gga(x1, x2, x3)  =  ways_in_gga(x1, x2)
0  =  0
ways_out_gga(x1, x2, x3)  =  ways_out_gga(x1, x2, x3)
[]  =  []
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
U4_gga(x1, x2, x3, x4, x5)  =  U4_gga(x1, x2, x3, x5)
=_in_ga(x1, x2)  =  =_in_ga(x1)
=_out_ga(x1, x2)  =  =_out_ga(x1, x2)
U5_gga(x1, x2, x3, x4, x5, x6)  =  U5_gga(x1, x2, x3, x6)
plus_in_gag(x1, x2, x3)  =  plus_in_gag(x1, x3)
U2_gag(x1, x2)  =  U2_gag(x1, x2)
nat_in_g(x1)  =  nat_in_g(x1)
nat_out_g(x1)  =  nat_out_g(x1)
U1_g(x1, x2)  =  U1_g(x1, x2)
plus_out_gag(x1, x2, x3)  =  plus_out_gag(x1, x2, x3)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x1, x3, x4)
U6_gga(x1, x2, x3, x4, x5, x6, x7)  =  U6_gga(x1, x2, x3, x6, x7)
U7_gga(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_gga(x1, x2, x3, x7, x8)
U8_gga(x1, x2, x3, x4, x5)  =  U8_gga(x1, x2, x3, x5)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
U2_gga(x1, x2)  =  U2_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x1, x2, x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x6)
U10_gga(x1, x2, x3, x4, x5)  =  U10_gga(x1, x2, x3, x5)
PLUS_IN_GGA(x1, x2, x3)  =  PLUS_IN_GGA(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                    ↳ UsableRulesProof
PiDP
                        ↳ PiDPToQDPProof
                  ↳ PiDP
                  ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

PLUS_IN_GGA(s(X), Y, s(Z)) → PLUS_IN_GGA(X, Y, Z)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
PLUS_IN_GGA(x1, x2, x3)  =  PLUS_IN_GGA(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                    ↳ UsableRulesProof
                      ↳ PiDP
                        ↳ PiDPToQDPProof
QDP
                            ↳ QDPSizeChangeProof
                  ↳ PiDP
                  ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

PLUS_IN_GGA(s(X), Y) → PLUS_IN_GGA(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
PiDP
                    ↳ UsableRulesProof
                  ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

PLUS_IN_GAG(s(X), Y, s(Z)) → PLUS_IN_GAG(X, Y, Z)

The TRS R consists of the following rules:

ways_in_gga(0, X, s(0)) → ways_out_gga(0, X, s(0))
ways_in_gga(X, [], 0) → ways_out_gga(X, [], 0)
ways_in_gga(Amount, .(s(C), Coins), N) → U4_gga(Amount, C, Coins, N, =_in_ga(Amount, s(X)))
=_in_ga(X, X) → =_out_ga(X, X)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U5_gga(Amount, C, Coins, N, X, plus_in_gag(s(C), NewAmount, Amount))
plus_in_gag(0, X, X) → U2_gag(X, nat_in_g(X))
nat_in_g(0) → nat_out_g(0)
nat_in_g(s(X)) → U1_g(X, nat_in_g(X))
U1_g(X, nat_out_g(X)) → nat_out_g(s(X))
U2_gag(X, nat_out_g(X)) → plus_out_gag(0, X, X)
plus_in_gag(s(X), Y, s(Z)) → U3_gag(X, Y, Z, plus_in_gag(X, Y, Z))
U3_gag(X, Y, Z, plus_out_gag(X, Y, Z)) → plus_out_gag(s(X), Y, s(Z))
U5_gga(Amount, C, Coins, N, X, plus_out_gag(s(C), NewAmount, Amount)) → U6_gga(Amount, C, Coins, N, X, NewAmount, ways_in_gga(Amount, Coins, N1))
U6_gga(Amount, C, Coins, N, X, NewAmount, ways_out_gga(Amount, Coins, N1)) → U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_in_gga(NewAmount, .(s(C), Coins), N2))
U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_out_gga(NewAmount, .(s(C), Coins), N2)) → U8_gga(Amount, C, Coins, N, plus_in_gga(N1, N2, N))
plus_in_gga(0, X, X) → U2_gga(X, nat_in_g(X))
U2_gga(X, nat_out_g(X)) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U3_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U3_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U8_gga(Amount, C, Coins, N, plus_out_gga(N1, N2, N)) → ways_out_gga(Amount, .(s(C), Coins), N)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U9_gga(Amount, C, Coins, N, X, plus_in_gag(Amount, s(X1), s(C)))
U9_gga(Amount, C, Coins, N, X, plus_out_gag(Amount, s(X1), s(C))) → U10_gga(Amount, C, Coins, N, ways_in_gga(Amount, Coins, N))
U10_gga(Amount, C, Coins, N, ways_out_gga(Amount, Coins, N)) → ways_out_gga(Amount, .(s(C), Coins), N)

The argument filtering Pi contains the following mapping:
ways_in_gga(x1, x2, x3)  =  ways_in_gga(x1, x2)
0  =  0
ways_out_gga(x1, x2, x3)  =  ways_out_gga(x1, x2, x3)
[]  =  []
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
U4_gga(x1, x2, x3, x4, x5)  =  U4_gga(x1, x2, x3, x5)
=_in_ga(x1, x2)  =  =_in_ga(x1)
=_out_ga(x1, x2)  =  =_out_ga(x1, x2)
U5_gga(x1, x2, x3, x4, x5, x6)  =  U5_gga(x1, x2, x3, x6)
plus_in_gag(x1, x2, x3)  =  plus_in_gag(x1, x3)
U2_gag(x1, x2)  =  U2_gag(x1, x2)
nat_in_g(x1)  =  nat_in_g(x1)
nat_out_g(x1)  =  nat_out_g(x1)
U1_g(x1, x2)  =  U1_g(x1, x2)
plus_out_gag(x1, x2, x3)  =  plus_out_gag(x1, x2, x3)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x1, x3, x4)
U6_gga(x1, x2, x3, x4, x5, x6, x7)  =  U6_gga(x1, x2, x3, x6, x7)
U7_gga(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_gga(x1, x2, x3, x7, x8)
U8_gga(x1, x2, x3, x4, x5)  =  U8_gga(x1, x2, x3, x5)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
U2_gga(x1, x2)  =  U2_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x1, x2, x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x6)
U10_gga(x1, x2, x3, x4, x5)  =  U10_gga(x1, x2, x3, x5)
PLUS_IN_GAG(x1, x2, x3)  =  PLUS_IN_GAG(x1, x3)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                    ↳ UsableRulesProof
PiDP
                        ↳ PiDPToQDPProof
                  ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

PLUS_IN_GAG(s(X), Y, s(Z)) → PLUS_IN_GAG(X, Y, Z)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
PLUS_IN_GAG(x1, x2, x3)  =  PLUS_IN_GAG(x1, x3)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                    ↳ UsableRulesProof
                      ↳ PiDP
                        ↳ PiDPToQDPProof
QDP
                            ↳ QDPSizeChangeProof
                  ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

PLUS_IN_GAG(s(X), s(Z)) → PLUS_IN_GAG(X, Z)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
PiDP
                    ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

U5_GGA(Amount, C, Coins, N, X, plus_out_gag(s(C), NewAmount, Amount)) → U6_GGA(Amount, C, Coins, N, X, NewAmount, ways_in_gga(Amount, Coins, N1))
WAYS_IN_GGA(Amount, .(s(C), Coins), N) → U4_GGA(Amount, C, Coins, N, =_in_ga(Amount, s(X)))
U6_GGA(Amount, C, Coins, N, X, NewAmount, ways_out_gga(Amount, Coins, N1)) → WAYS_IN_GGA(NewAmount, .(s(C), Coins), N2)
U4_GGA(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U5_GGA(Amount, C, Coins, N, X, plus_in_gag(s(C), NewAmount, Amount))
U5_GGA(Amount, C, Coins, N, X, plus_out_gag(s(C), NewAmount, Amount)) → WAYS_IN_GGA(Amount, Coins, N1)
U9_GGA(Amount, C, Coins, N, X, plus_out_gag(Amount, s(X1), s(C))) → WAYS_IN_GGA(Amount, Coins, N)
U4_GGA(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U9_GGA(Amount, C, Coins, N, X, plus_in_gag(Amount, s(X1), s(C)))

The TRS R consists of the following rules:

ways_in_gga(0, X, s(0)) → ways_out_gga(0, X, s(0))
ways_in_gga(X, [], 0) → ways_out_gga(X, [], 0)
ways_in_gga(Amount, .(s(C), Coins), N) → U4_gga(Amount, C, Coins, N, =_in_ga(Amount, s(X)))
=_in_ga(X, X) → =_out_ga(X, X)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U5_gga(Amount, C, Coins, N, X, plus_in_gag(s(C), NewAmount, Amount))
plus_in_gag(0, X, X) → U2_gag(X, nat_in_g(X))
nat_in_g(0) → nat_out_g(0)
nat_in_g(s(X)) → U1_g(X, nat_in_g(X))
U1_g(X, nat_out_g(X)) → nat_out_g(s(X))
U2_gag(X, nat_out_g(X)) → plus_out_gag(0, X, X)
plus_in_gag(s(X), Y, s(Z)) → U3_gag(X, Y, Z, plus_in_gag(X, Y, Z))
U3_gag(X, Y, Z, plus_out_gag(X, Y, Z)) → plus_out_gag(s(X), Y, s(Z))
U5_gga(Amount, C, Coins, N, X, plus_out_gag(s(C), NewAmount, Amount)) → U6_gga(Amount, C, Coins, N, X, NewAmount, ways_in_gga(Amount, Coins, N1))
U6_gga(Amount, C, Coins, N, X, NewAmount, ways_out_gga(Amount, Coins, N1)) → U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_in_gga(NewAmount, .(s(C), Coins), N2))
U7_gga(Amount, C, Coins, N, X, NewAmount, N1, ways_out_gga(NewAmount, .(s(C), Coins), N2)) → U8_gga(Amount, C, Coins, N, plus_in_gga(N1, N2, N))
plus_in_gga(0, X, X) → U2_gga(X, nat_in_g(X))
U2_gga(X, nat_out_g(X)) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y, s(Z)) → U3_gga(X, Y, Z, plus_in_gga(X, Y, Z))
U3_gga(X, Y, Z, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U8_gga(Amount, C, Coins, N, plus_out_gga(N1, N2, N)) → ways_out_gga(Amount, .(s(C), Coins), N)
U4_gga(Amount, C, Coins, N, =_out_ga(Amount, s(X))) → U9_gga(Amount, C, Coins, N, X, plus_in_gag(Amount, s(X1), s(C)))
U9_gga(Amount, C, Coins, N, X, plus_out_gag(Amount, s(X1), s(C))) → U10_gga(Amount, C, Coins, N, ways_in_gga(Amount, Coins, N))
U10_gga(Amount, C, Coins, N, ways_out_gga(Amount, Coins, N)) → ways_out_gga(Amount, .(s(C), Coins), N)

The argument filtering Pi contains the following mapping:
ways_in_gga(x1, x2, x3)  =  ways_in_gga(x1, x2)
0  =  0
ways_out_gga(x1, x2, x3)  =  ways_out_gga(x1, x2, x3)
[]  =  []
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
U4_gga(x1, x2, x3, x4, x5)  =  U4_gga(x1, x2, x3, x5)
=_in_ga(x1, x2)  =  =_in_ga(x1)
=_out_ga(x1, x2)  =  =_out_ga(x1, x2)
U5_gga(x1, x2, x3, x4, x5, x6)  =  U5_gga(x1, x2, x3, x6)
plus_in_gag(x1, x2, x3)  =  plus_in_gag(x1, x3)
U2_gag(x1, x2)  =  U2_gag(x1, x2)
nat_in_g(x1)  =  nat_in_g(x1)
nat_out_g(x1)  =  nat_out_g(x1)
U1_g(x1, x2)  =  U1_g(x1, x2)
plus_out_gag(x1, x2, x3)  =  plus_out_gag(x1, x2, x3)
U3_gag(x1, x2, x3, x4)  =  U3_gag(x1, x3, x4)
U6_gga(x1, x2, x3, x4, x5, x6, x7)  =  U6_gga(x1, x2, x3, x6, x7)
U7_gga(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_gga(x1, x2, x3, x7, x8)
U8_gga(x1, x2, x3, x4, x5)  =  U8_gga(x1, x2, x3, x5)
plus_in_gga(x1, x2, x3)  =  plus_in_gga(x1, x2)
U2_gga(x1, x2)  =  U2_gga(x1, x2)
plus_out_gga(x1, x2, x3)  =  plus_out_gga(x1, x2, x3)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x1, x2, x4)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x6)
U10_gga(x1, x2, x3, x4, x5)  =  U10_gga(x1, x2, x3, x5)
U4_GGA(x1, x2, x3, x4, x5)  =  U4_GGA(x1, x2, x3, x5)
U9_GGA(x1, x2, x3, x4, x5, x6)  =  U9_GGA(x1, x2, x3, x6)
U6_GGA(x1, x2, x3, x4, x5, x6, x7)  =  U6_GGA(x1, x2, x3, x6, x7)
U5_GGA(x1, x2, x3, x4, x5, x6)  =  U5_GGA(x1, x2, x3, x6)
WAYS_IN_GGA(x1, x2, x3)  =  WAYS_IN_GGA(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP

Q DP problem:
The TRS P consists of the following rules:

U4_GGA(Amount, C, Coins, =_out_ga(Amount, s(X))) → U5_GGA(Amount, C, Coins, plus_in_gag(s(C), Amount))
U4_GGA(Amount, C, Coins, =_out_ga(Amount, s(X))) → U9_GGA(Amount, C, Coins, plus_in_gag(Amount, s(C)))
WAYS_IN_GGA(Amount, .(s(C), Coins)) → U4_GGA(Amount, C, Coins, =_in_ga(Amount))
U5_GGA(Amount, C, Coins, plus_out_gag(s(C), NewAmount, Amount)) → WAYS_IN_GGA(Amount, Coins)
U6_GGA(Amount, C, Coins, NewAmount, ways_out_gga(Amount, Coins, N1)) → WAYS_IN_GGA(NewAmount, .(s(C), Coins))
U5_GGA(Amount, C, Coins, plus_out_gag(s(C), NewAmount, Amount)) → U6_GGA(Amount, C, Coins, NewAmount, ways_in_gga(Amount, Coins))
U9_GGA(Amount, C, Coins, plus_out_gag(Amount, s(X1), s(C))) → WAYS_IN_GGA(Amount, Coins)

The TRS R consists of the following rules:

ways_in_gga(0, X) → ways_out_gga(0, X, s(0))
ways_in_gga(X, []) → ways_out_gga(X, [], 0)
ways_in_gga(Amount, .(s(C), Coins)) → U4_gga(Amount, C, Coins, =_in_ga(Amount))
=_in_ga(X) → =_out_ga(X, X)
U4_gga(Amount, C, Coins, =_out_ga(Amount, s(X))) → U5_gga(Amount, C, Coins, plus_in_gag(s(C), Amount))
plus_in_gag(0, X) → U2_gag(X, nat_in_g(X))
nat_in_g(0) → nat_out_g(0)
nat_in_g(s(X)) → U1_g(X, nat_in_g(X))
U1_g(X, nat_out_g(X)) → nat_out_g(s(X))
U2_gag(X, nat_out_g(X)) → plus_out_gag(0, X, X)
plus_in_gag(s(X), s(Z)) → U3_gag(X, Z, plus_in_gag(X, Z))
U3_gag(X, Z, plus_out_gag(X, Y, Z)) → plus_out_gag(s(X), Y, s(Z))
U5_gga(Amount, C, Coins, plus_out_gag(s(C), NewAmount, Amount)) → U6_gga(Amount, C, Coins, NewAmount, ways_in_gga(Amount, Coins))
U6_gga(Amount, C, Coins, NewAmount, ways_out_gga(Amount, Coins, N1)) → U7_gga(Amount, C, Coins, N1, ways_in_gga(NewAmount, .(s(C), Coins)))
U7_gga(Amount, C, Coins, N1, ways_out_gga(NewAmount, .(s(C), Coins), N2)) → U8_gga(Amount, C, Coins, plus_in_gga(N1, N2))
plus_in_gga(0, X) → U2_gga(X, nat_in_g(X))
U2_gga(X, nat_out_g(X)) → plus_out_gga(0, X, X)
plus_in_gga(s(X), Y) → U3_gga(X, Y, plus_in_gga(X, Y))
U3_gga(X, Y, plus_out_gga(X, Y, Z)) → plus_out_gga(s(X), Y, s(Z))
U8_gga(Amount, C, Coins, plus_out_gga(N1, N2, N)) → ways_out_gga(Amount, .(s(C), Coins), N)
U4_gga(Amount, C, Coins, =_out_ga(Amount, s(X))) → U9_gga(Amount, C, Coins, plus_in_gag(Amount, s(C)))
U9_gga(Amount, C, Coins, plus_out_gag(Amount, s(X1), s(C))) → U10_gga(Amount, C, Coins, ways_in_gga(Amount, Coins))
U10_gga(Amount, C, Coins, ways_out_gga(Amount, Coins, N)) → ways_out_gga(Amount, .(s(C), Coins), N)

The set Q consists of the following terms:

ways_in_gga(x0, x1)
=_in_ga(x0)
U4_gga(x0, x1, x2, x3)
plus_in_gag(x0, x1)
nat_in_g(x0)
U1_g(x0, x1)
U2_gag(x0, x1)
U3_gag(x0, x1, x2)
U5_gga(x0, x1, x2, x3)
U6_gga(x0, x1, x2, x3, x4)
U7_gga(x0, x1, x2, x3, x4)
plus_in_gga(x0, x1)
U2_gga(x0, x1)
U3_gga(x0, x1, x2)
U8_gga(x0, x1, x2, x3)
U9_gga(x0, x1, x2, x3)
U10_gga(x0, x1, x2, x3)

We have to consider all (P,Q,R)-chains.